• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

close() / reconnect() / disconnect() question

 
Ranch Hand
Posts: 547
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi

after i called Session.close() i can still retrieve a Connection trough the Session.connection() method. Shouldnt this method throw an Exception or return null after close() ?

Also after Session.close() i can call Session.reconnect() and get a Exception telling me that the Session is already connected. From what i read in the API the Session.close() cleans up and disconnects the session (yup, i know that i should not reconnect a closed session ... i was just experimenting and this exception puzzled me)

cheers

pascal
 
author
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah looks like you noticed a little bug. This occurs only if you have a session that never uses the JDBC connection (not even to commit the transaction) which would never occur in practice.

Its a trivial fix.
 
So you made a portal in time and started grabbing people. This tiny ad thinks that's rude:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic