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 am trying to update from mac os x 10.5.4 to 10.5.7. I went on the apple site and downloaded 10.5.7 but then read that it would be better to download the combo. I did this and it took about 5 hours. When it was done, I double clicked it in my downlo [More]
I'll make this short: . Had problems upgrading Touch firmware 2. Touch is now stuck in recovery mode no matter what I do 3. Tried to re-upgrade firmware 4. Computer connects to player (docking screen comes up) 5. Firmware app says I am not connected [More]
Hello, I have a problem to appropriate down payment for "AuC" using F110 tcode: We work with CJ20N> Project Builder> WBS Element> Network> activity> Purchase Requisition. With the transaction ME21N> creation of the Purchase Ord [More]
I have just upgraded to Ap 3.1. I used to import multiple SD cards in succession after a trip away, and it seemed fairly simple: 1. Insert card 1 to iMac card reader 2. import images 3. use aperture to delete files from the card, and then move on to [More]
I had bought an HP 2311x  and when I received it I hooked it up and the screen has alot of different colors, lines, and blurryness. Now after I hooked the monitor up to my pc I checked all the connections and power and everything was working fine. I [More]
My outlook 2011 version 14.3.8 linked up fine with my macbook pro with retina display however after a few weeks all my account details disappeared and i have to sync it all over again. How do i stop this from happening again. Im using OS X 10.8.5 All [More]
I ordered an X220 with IPS long time ago. I remember seeing a while ago the name as "Wide viewing angle & High density FlexView Display 1366 x 768" but now that I see this "Generic PnP Monitor" I am not sure if it was my imaginatio [More]
Hello, does someone knows how to download all the data from a incomplete backup that is on iCloud. I saw i some days ago, and maybe there is some photos that I had lost http://imgur.com/Z5aVbBJ PS: I already try Dr. Phone and it just shows the comple [More]
After I installed a Solaris 8 OS from scratch, i installed the iPlanet Directory Server. (express setup) ids_5_0_.tar To test it, i tried to start the console: /usr/iplanet/servers/startconsole -D9 Did i made anything wrong ? Output: /usr/iplanet/ser [More]
I am trying to setup a simple "SQL script" corrective action and want to pass in the object being monitored to the script. For example, in my tablespace %used metric I have defined a corrective action that calls a SQL script on the local host. I [More]