Announcement Announcement Module
Collapse
No announcement yet.
transaction/connection problem upgrading from spring 1.2.2 to 2.0.6 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • transaction/connection problem upgrading from spring 1.2.2 to 2.0.6

    Hello,

    I just tried upgrading our web application from spring 1.2.2 to 2.0.6, but I started getting strange database access errors. I did some digging and found the source of my problem.

    We are using hibernate 3.2.2, and have the hibernate.connection.release_mode explicitly set to on_close because we require the same connection to be used for an entire hibernate session (we do some custom connection preparation when opening the session).

    In HibernateTransactionManager.doCleanupAfterCompleti on, I found this near the end (in the cleanup of a pre-bound hibernate session that is not closed):

    Code:
    // Running against Hibernate 3.1+...
    // Let's explicitly disconnect the Session to provide efficient Connection handling
    // even with connection release mode "on_close". The Session will automatically
    // obtain a new Connection in case of further database access.
    // Couldn't do this on Hibernate 3.0, where disconnect required a manual reconnect.
    session.disconnect();
    This does not seem to honor the on_close connection release mode. The hibernate session is not being closed, yet the connection is being closed here.

    1. Why it was done this way?

    2. Is there some way (that I have missed) to get the old behavior back to ensure my hibernate session retains the same connection until the session is closed?

    Thanks,
    Joe

  • #2
    I think this might be the source of my problem

    My thread
    http://forum.springframework.org/showthread.php?t=41754

    Comment

    Working...
    X