This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Kubernetes in Action and have Marko Luksa on-line!
See this thread for details.
Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JDBC connection state after ending session  RSS feed

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using XML/XSL/XSP to build website. I have a xsp page which contains database accessing coding and I have "finally" block to close connections, of course. My question is : if a user end the session by any means ( either logout or close the browser ) during the database transaction, will the finally block executed or not ?
Any advice is appreciated.
Lily
 
Ranch Hand
Posts: 1512
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since the finally block is supposed to execute if there was an excepton or not, I believe it should execute, because the browser will terminate the session.
------------------
Bosun
SCJP for the Java� 2 Platform
 
lily ling
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you ,Bosun.
By the way, may I ask if the user terminate the session, what kind of exception the JVM will get ?
Lily
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!