Results 1 to 2 of 2

Thread: transaction/connection problem upgrading from spring 1.2.2 to 2.0.6

  1. #1
    Join Date
    Aug 2004
    Posts
    2

    Default 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. #2

    Default I think this might be the source of my problem

    mmmm, I think I will order a cup of coffee in this beautiful spring day

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •