Sitemap

Amicuk Programming Answers

About Container-managed Transactions and Bean-managed Transactions

2015-10-11   Views:2

Advertisement

as the document of weblogic7.0 describe the differents of Container-managed           Transactions and Bean-managed Transactions,and in the document,It tell us           details of using Bean-managed Transactions,such as \:           import javax.nam

as the document of weblogic7.0 describe the differents of Container-managed
          Transactions and Bean-managed Transactions,and in the document,It tell us
          details of using Bean-managed Transactions,such as \:
          import javax.naming.*;import javax.transaction.UserTransaction;.....
          import java.sql.*;import java.util.*;
          UserTransaction tx = (UserTransaction)
          ctx.lookup("javax.transaction.UserTransaction");tx.begin();
          tx.commit() //or tx.rollback
          but how to use Container-managed Transactions?
          what is EJB's deployment descriptor? can someone tell me?
          i wonder someone will show me an example of how to use Container-managed
          Transactions.
          thanks
          fish
          

The replay answer
Advertisement
Many if not all of the WLS EJB examples use container-managed
          transactions. That's a good place to start.
          I'd also recommend that you pick up a decent EJB book. There's several
          on the market right now.
          -- Rob
          fish wrote:
          > <ejb-jar>
          > <enterprise-beans>
          > <session>
          > <ejb-name>testbean</ejb-name>
          > <home>test.test.TestHome</home>
          > <remote>test.test.Test</remote>
          > <ejb-class>test.test.TestBean</ejb-class>
          > <session-type>Stateful</session-type>
          > <transaction-type>Container</transaction-type>
          > </session>
          > </enterprise-beans>
          >
          > <assembly-descriptor>
          > <container-transaction>
          > <method>
          > <ejb-name>EmployeeRecord</ejb-name>
          > <method-name>*</method-name>
          > </method>
          > <trans-attribute>Required</trans-attribute>
          > </container-transaction>
          > </assembly-descriptor>
          > </ejb-jar>
          > ----------------------------------------------
          > seems i have to write ejb-jar.xml like this,am i right?
          > what about <ejb-client-jar>? is it needed in this xml file?
          >
          > thanks
          >
          > fish
          >
          >
          

Go to See the other 5 answers

Bean-managed transaction with EJB 3.0

Category:DefaultRelease time:2015-10-11Views:130

Hi, I try to get a bean-managed transaction example running with EJB 3.0 under GlassFish v2ur2. In order to demarcate the scenario I have to get me the UserTransaction which I get from the SessionContext. I would like to use it then like: UserTransac[More]

Two phase commit and bean managed transactions

Category:DefaultRelease time:2015-10-11Views:130

To all the Transaction GURUS!           Hi guys (-and gals).           I've been doing J2EE for quite a while, but today was my first at           XA-Transactions and Bean Managed Transactions.           Why am I doing this?           ===============[More]

Container-managed / bean-managed transaction demarcation

Category:DefaultRelease time:2015-10-11Views:130

I am trying to make sure I understand container-managed and bean-managed transaction demarcation and in particular where you have one bean calling another bean. What happens where one of the beans has container-managed transaction demarcation and the[More]

About Container-managed Transactions and Bean-managed Transactions

Category:DefaultRelease time:2015-10-11Views:130

as the document of weblogic7.0 describe the differents of Container-managed           Transactions and Bean-managed Transactions,and in the document,It tell us           details of using Bean-managed Transactions,such as \:           import javax.nam[More]

Transaction management in stateless session beans.

Category:DefaultRelease time:2015-10-11Views:130

Hi all, I am using EJB 1.1. I have a statless session bean that has two methods- A and B. which does not involve any database interaction like inserting/updating/deleting the data in the database. The process flow is such the client always calls A fi[More]

Entity Bean can only use container-managed transaction demarcation?

Category:DefaultRelease time:2015-10-11Views:130

In <<Designing Enterprise Application with J2EE 2nd>> Section 2.3.3.3 Enterprise Bean Transactions,it says:Entity beans can only use container-managed transaction demarcation. That means,i can not get UserTransaction from EJBContext. Is that t[More]

Bean-Managed Transaction and xDoclet

Category:DefaultRelease time:2015-10-11Views:130

Hi, i am new by xDoclet. Does anybody know, how to specify Bean-Managed Transaction by EJB using xDoclet. Thank you very much for any hint or link. --Eugen                                                                                               [More]

Bean Managed Transactions and rollback

Category:DefaultRelease time:2015-10-11Views:130

Hi Everybody, I am using Bean Managed Transactions in a Message Bean which is called every some time by an EJB3 timer. This Message Bean subsequently calls a Session Bean which uses Container Managed Transactions and uses the default transaction attr[More]

Bean Managed Transactions

Category:DefaultRelease time:2015-10-11Views:130

Dumb question? Is there a way to change one of the methods in a container-managed bean so that it is bean-managed?More specifically, I'm confused by the format for ejb-jar.xml. If I use the following to specify whether a bean is managed by the contai[More]

Can i call Bean managed EJB with transaction attribute Required New

Category:DefaultRelease time:2015-10-11Views:130

          I am calling a BeanManaged EJB which has a transaction attribute           set to Required New from a container managed bean. Does it create a new transaction           other than the Bean managed transaction. Do i really need a required ne[More]

Can i user UserTransaction  in a Container-managed transaction Bean

Category:DefaultRelease time:-0001-11-30Views:130

can i use UserTransaction to control transaction boundaries in a container-managed transaction bean method? below is the method: there is one-to-many between Employees and SalaryItem @TransactionAttribute(value = TransactionAttributeType.REQUIRED) pr[More]

Hot
I update firefox and was asked how I wanted tabs displayed. I orignally had new tabs opening across the top of the screen but changed a setting so they came up on the sidebar. I want to go back to tabs across the top of the screen but can't find how [More]
i recently purchased a new iphone 5 and it has locked me out from my account because i do not know my security questions, can i transfer the money into a new account or change my questions... i have been locked out from changing my password and other [More]
I have a UCCX version 7.0(2)_Build254 and CAD installed . One of my agent switch to no ready and no phone call through your number . Does exist a timer to modify at UCCX ? Thanks and best regards Hugowhat  are you trying to do here? Put the agent bac [More]
For some time now, when I connect my iPod to my PC, I'm told my iPod cannot be synced to iTunes because (the file cannot be found).  What gives?Sounds like the file yo are trying to sync to the iPod is corrupted. Try syncing only one item that plays [More]
just bought this phone to help ff but i found out they are irresponcible.zte is careless about updates, i tried manualy signatur prblm updte faild, no real sport from anyone.i m not that rich .i could have buy food for my famely for all week for the [More]
I know with image replicator you can take a series of numbered JPGs for example, image001.jpg, image002.jpg, image003.jpg etc and group them into image[###].jpg so replicator can use them. My question is about replicator using a MOV file: I know that [More]
Hi people, Recently, I am thinking what happens if that someone uses my iCloud to transfer my data. My question is, do I get a notification of some sort if someone logs in to/out of my iCloud account. Is there an option to prefer receiving such notif [More]
Hi skilled! Is there any environment to access  Oracle 10g OLAP Analytic Worspace from BOE XI (not from BOE XIR2) for Universes creating ? Thank you.Hello Walter, Thanks for the response. I'm using the following SAP GUI: 710 Final Release, Version 71 [More]
Having trouble transferring photos frm iPad to PC. Have done it before using lightening to USB but sine update to iOS7 it says there are no photosTry this  - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-1 [More]
Hi all If I change max-beans-in-cache property then do I need to redeploy (run ejbc on) the stateful session beans or will the server pick it up when I just restart the app server. I am using Weblogic 6.1 SP2 Regards Kamran YousafI believe I was wond [More]