IntelliJ Java IDE
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Transaction related Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » EJB Certification (SCBCD/OCPJBCD)
Reply Bookmark "Transaction related" Watch "Transaction related" New topic
Author

Transaction related

Keerthi P
Ranch Hand

Joined: Aug 19, 2003
Posts: 203
Assuming... a session bean reads (selects) some rows from a database. The method that performs this operation runs in a NOTSUPPORTED transaction context. Can I set an isolation level for this method? Will isolation level apply for a bean's method that does not run in the context of a transaction ?


Cheers.<br />Keerthi<br />(SCJP, SCWCD, SCBCD)
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8845

You can do a class.forname(), then get the connection and set the isolation level on the connection , start a tx and commit/rollback it.


Groovy
Rajeshrkd Venkatesan
Greenhorn

Joined: Sep 22, 2003
Posts: 1
Originally posted by Keerthi Panneer:
Assuming... a session bean reads (selects) some rows from a database. The method that performs this operation runs in a NOTSUPPORTED transaction context. Can I set an isolation level for this method? Will isolation level apply for a bean's method that does not run in the context of a transaction ?

IMHO, most of the isolation levels such as REPEATABLE_READ AND SERIALIZABLE don't make any sense if the SB don't support a transaction. This is because, typically a lock is obtained when you access the object and is retained for the duration of the transaction(pessimistic concurrency) and the lock is released at the end of the transaction. And by obtaining the lock is how you achieve the transaction isolation.
But having said that, for READ_COMMITTED isolation level I don't think the SB has to support transaction, sicne I this case no lock is obtained but rather just a check is made to see whether the data is in a stable committed state.
Any other opinions are most welcome.
Juan Rolando Prieur-Reza
Ranch Hand

Joined: Jun 20, 2003
Posts: 233
The Isolation levels in SQL Server, or Oracle, have the same effect regardless of whether the queries (update, delete, etc) are within transactions.
I hope this functionality simply passed through to EJBs.
... to the best of my knowledge.
[ October 13, 2003: Message edited by: john prieur ]

Juan Rolando Prieur-Reza, M.S., LSSBB, SCEA, SCBCD, SCWCD, SCJP/1.6, IBM OOAD, SCSA
 
 
subject: Transaction related
 
Threads others viewed
Transaction Isolation levels in Weblogic
Where to put per method transaction level for EJB
locking of database record
Performance Issues - Transaction Isolation Levels
transaction isolation
MyEclipse, The Clear Choice

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture