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.