Results 1 to 3 of 3

Thread: Hibernate Interceptor and Transactions

  1. #1
    Join Date
    Nov 2004
    Posts
    7

    Default Hibernate Interceptor and Transactions

    I've been using an Interceptor for Hibernate 2 and from the beforeTransactionCompletion callback I was calling code intercepted by the TransactionInterceptor.
    Everything worked fine and I could see all the changes from both transactions.

    Now I've switched to Hibernate 3 and It seems that is running well, but the changes made by the called code (the nested transaction) are not visible after the first transaction is commited.

    I'm using PROPAGATION_REQUIERED transactions.

    Any idea?

    Thanks

  2. #2
    Join Date
    Nov 2004
    Posts
    7

    Default

    To solve the problem I've forced a flush on the Hibernate session explicitly.
    But tis was not necessary with the Hibernate 2 Transaction Interceptor. Why?

    Thanks

  3. #3
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    The internals of HB have been changed quite a lot since 2.x version. Even now 3.1 adds new behavior in regards to auto-commits. You can take a debugger and step throw the sources or look directly at what HB does behind.
    You can check the Spring code also to make sure there aren't changes between support for HB 2 and HB3.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Posting Permissions

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