Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTA and Container managed transactions

 
Srinivas Ramgopal
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

In weblogic, there is one stateless session bean (SLSB) as facade to an application that has POJOs.
I do not want to set any transaction settings on the SLSB, instead I want to use Spring declarative transaction setting on one of the POJOs (There are 5 pojos used in a workflow and I want to declare transaction settings at 4th pojo only).

I have few basic questions about EJB and JTA in java 5:

1) I want to use container managed bean (CMT) only, for the above SLSB, is it possible because I do not want to set any transaction at this level?

2) What is the default transaction setting for a CMP in weblogic?

3) If I extend this above scenario to use JTA( hitting 2 databases in a single transaction), can I still use CMP in weblogic?

4) In case a single transaction that hits more than one database, can declarative transaction management along with
javax.transaction.Transaction be used?

If so, how is it different from javax.transaction.xa?

Can you give an example of code.

6) Is the transaction processing different for Message driven beans in distributed and local transactions?

5) Are there any good books to understand JTA usuage in EJB world?



Thanks in advance for your valuable time and interest.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

1) I want to use container managed bean (CMT) only, for the above SLSB, is it possible because I do not want to set any transaction at this level?


Yes its possible. You can set the transaction attribute to NOTSUPPORTED. For more options, have a look at: CMT attributes

2) What is the default transaction setting for a CMP in weblogic?


Not sure. AFAIK, the spec does not mention what the default transaction attribute should be. You will have to check the Weblogic docs for this.


4) In case a single transaction that hits more than one database, can declarative transaction management along with
javax.transaction.Transaction be used?

If so, how is it different from javax.transaction.xa?


You can still use declarative transaction management but the resources that will be part of this transaction will have to be a XA resource. This thread on the serverside.com has a good explanation about XA and non-XA resource(see the post by Mike Spille)

6) Is the transaction processing different for Message driven beans in distributed and local transactions?


Not sure, i understood the question right.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic