This week's book giveaway is in the Testing forum.
We're giving away four copies of Data Structures the Fun Way: An Amusing Adventure with Coffee-Filled Examples and have Jeremy Kubica on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Transaction related

 
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?
 
Ranch Hand
Posts: 8944
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
I am Arthur, King of the Britons. And this is a tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic