• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with transaction Attribute

 
Arun Maalik
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear sir would you please clearify me the diffrence between Required and NotSupported transaction attribute.

I have read in book that if the transaction is not running both will create a new transaction then what is diffrence between them.

with regard

Arun kumar maalik
 
Masoud Kalali
Author
Ranch Hand
Posts: 531
Java Mac OS X Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it is not correct that both of them create transactions.

Required means that the bean's method must be invoked within a transaction context. if the client that invoke the method which is marked with this attribute be in a transaction scope then this method will go under that transaction scope , if the client that call the method marked with this attribute does not involed in any transaction then a transaction for the method execution will create and the created transaction will end by method return.

NotSupported , it means that the method marked with this attribute does not support transaction , so if the client whom call this method be within a transaction scope then transaction will pause until the method execution ends, then transaction will resume.

hth
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!