Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Identifying Database Locked scenario

 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not sure whether i am posting this in the correct forum. We are using SLSB(CMT) and Hibernate in our application. One of our SLSB interacts with the database for database operations. We are trying to find a way through which we can show the user a message whenever the Database is locked(may be for backup).
Here's our scenario:
- User through jsp does some operation, which results in the invocation of the SLSB
- The SLSB(with CMT) then does a database operation
- Consider a scenario in which the database is locked. In such a case the SLSB just waits(even after the transaction timeout). As a result the application just hangs.

The scenario occurs very rarely, but we would like to show a message to the user the database is currently locked. Is this possible? Any suggestions are welcome.

Thank you
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What does your server log say? Surely there must be a exception thrown by the EJB container when the transaction times out. When this happens, I would expect the container to mark the transaction for rollback and throw RemoteException or EJBException to the client. Does the client receive any exceptions?
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's only a WARN message printed in the server log after the transaction times out. The transaction manager won't throw exceptions while the SLSB is waiting for the blocked database operation to complete (unless the SLSB does subsequent operations that involve the transaction manager)
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What EJB server are you using? It is not behaving in the way I would expect. When an EJB's transaction times out, I would expect the server to end (rollback) the transaction.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using JBoss-3.2.3. When the transaction times out the server marks the transaction for rollback and later on whenever any operation is done in context of this transaction, the exception is thrown
 
It's a tiny ad. At least, that's what she said.
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic