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
All, My environment is Oracle - 10.2.0.4.0 Linux - 2.6 2 Node RAC environment I have a job which is listed in DBA_JOBS. It is not auto executing. When I run manually, I am getting error. Please see the error details below. SQL> exec dbms_job.run(1); [More]
I CANT BUY ANYTHING FROM THE APP  STORE. I HAVE TRYED MULTIBLE TIME AND I JUST GET THIS MESSAGE SAYING THAT MY CREDIT CARD INFO NEED TO BE UPDATED. IV UPDATED MY INFO 5 TIME NOW AND IT HASENT CHANGE A THING. THE SAME MESSAGE COME UP EVERY TIME. IV CA [More]
How to restrict update to a document in state release to the contribution group. Hi I'm working with UCM 10g and I want to know if it is possible to restrict the update over a document that is on state release for the group of users that made the che [More]
We have a requirement to print Structured graphics. I found out that we need to set up a postscript printer for it. After debugging I found out that the Device Type name should be either GRAPHICS or POSTGR or ZGRAP. How can we set up such a printer? [More]
hi,         how to increase the font size in the output of classical report.. Gowrihi, its not possible to increase the font size in classical report. regard, madhuri.Read other 6 answers [More]
Hi All.. I have a rather frustrating scenerio here and could do with a few pointers as things arn't going my way I recently purchased two new AP 802.11ac for my home network, setup as follows: - Sky Modem 20Mbps IP 192.168.0.1 DHCP Ethernet Airport E [More]
the buttons on the top row of my computer is there a way to tun off and on?Click on the 'systems preferences' icon that is located on your dock ( it looks like the three little gears) and then click on 'keyboard'. Select the 'Use all F1, F2, Ect,' ch [More]
I have always used Firefox on my MacBook Air. But since updating to the latest version of Firefox (7.0.1), it freezes as soon as I open it - there is a constantly running "Connecting..." message, and the little circle turns continuously, and the [More]
My iphone 5 is working great but I have been inconvenienced in the past because I couuld not access my contacts. I dropped my phone in a glass of koolade 45 days before the new iphone was released. I had to wait 2 months to actually reveive my new ip [More]
Hi All, I am trying to form a dynamic where clause using values entered on a selection screen. I want that if a new entry is added in the selection screen the where clause can also be modified dynamically without any change in coding. The only change [More]