Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Transactions  RSS feed

 
Priya Jotwani
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I have a very basic Question as to when Transaction comes into picture.I came across a piece of code (Stateless Session Bean) which doesnot specify any Transaction Attribute in its Deployement Descriptor .
How Transaction is dealt with in this scenario ?
Thanks in Advance.
 
Vinod John
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Priya Jotwani:
Hi All,
I have a very basic Question as to when Transaction comes into picture.I came across a piece of code (Stateless Session Bean) which doesnot specify any Transaction Attribute in its Deployement Descriptor .
How Transaction is dealt with in this scenario ?
Thanks in Advance.

The spec doesn't define any default transaction attribute, though the assemply-descriptor tag isn't mandatory, but app servers (like weblogic) still defaults the transcation attribute value to some thing .. in case of weblogic I think it is supported (verify with the app server documentation)
 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vinod John:

The spec doesn't define any default transaction attribute, though the assemply-descriptor tag isn't mandatory, but app servers (like weblogic) still defaults the transcation attribute value to some thing .. in case of weblogic I think it is supported (verify with the app server documentation)

If it is container managed transaction, i guess it is mandatory to specify the transaction attribute for *every* method. Am not sure if i recollect properly, but our beans used to fail "ejbc" in case we accidentally miss the trans-attribute for even one method. We did use weblogic6.1
Ofcourse we have Lasse / Pradeep to confirm this :-)
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
trans-attribute is not mandatory. It is up to app server to deal with the situation. Vinod is right is saying that weblogic has a default transaction attribute if not specified.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From BEA weblogic 6.1 docs
Note: If the EJB provider does not specify a transaction attribute for a method in the ejb-jar.xml file, WebLogic Server uses the supports attribute by default.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!