Loading ...
Sorry, an error occurred while loading the content.

Re: [Firebird-Java] Nested Transactions

Expand Messages
  • Roman Rokytskyy
    ... After short googling I found Javadoc for HibernateTransactionManager in Spring Framework: On JDBC 3.0, this transaction manager supports nested
    Message 1 of 7 , Feb 1, 2006
    • 0 Attachment
      > Do you know if there anything I need to "turn it on" when using Hibernate?
      > The HibernateTransactionManager doesn't seem to support it, but Hibernate
      > site says it is dependent on the underlying JDBC driver?

      After short googling I found Javadoc for HibernateTransactionManager in
      Spring Framework:

      "On JDBC 3.0, this transaction manager supports nested transactions via JDBC
      3.0 Savepoints. The "nestedTransactionAllowed" flag defaults to "false",
      though, as nested transactions will just apply to the JDBC Connection, not
      to the Hibernate Session and its cached objects."

      ... though I could not find anything about savepoints in Hibernate (neither
      Google nor in source code of Hibernate 3.0)... Are you sure that this
      feature is supported by Hibernate?

      And sure, you can emulate it by accessing the connection object and using
      JDBC there, but in this case you might have problems anyway - it requires
      that before you set savepoint you have to flush everything to database. Then
      if you rollback, you have to expunge everything from the Hibernate's cache
      to force it to load data from the disk.

      Roman
    • dhay@lexmark.com
      Hey Roman, Thanks for the info!! I ll dig a little deeper... cheers, David ... Hibernate? ... After short googling I found Javadoc for
      Message 2 of 7 , Feb 1, 2006
      • 0 Attachment
        Hey Roman,

        Thanks for the info!! I'll dig a little deeper...

        cheers,

        David


        |---------+----------------------------->
        | | "Roman Rokytskyy" |
        | | <rrokytskyy@...|
        | | g> |
        | | Sent by: |
        | | Firebird-Java@yaho|
        | | ogroups.com |
        | | |
        | | |
        | | 02/01/2006 10:19 |
        | | AM |
        | | Please respond to |
        | | Firebird-Java |
        | | |
        |---------+----------------------------->
        >------------------------------------------------------------------------------------------------------------------------------|
        | |
        | To: <Firebird-Java@yahoogroups.com> |
        | cc: |
        | Subject: Re: [Firebird-Java] Nested Transactions |
        >------------------------------------------------------------------------------------------------------------------------------|




        > Do you know if there anything I need to "turn it on" when using
        Hibernate?
        > The HibernateTransactionManager doesn't seem to support it, but Hibernate
        > site says it is dependent on the underlying JDBC driver?

        After short googling I found Javadoc for HibernateTransactionManager in
        Spring Framework:

        "On JDBC 3.0, this transaction manager supports nested transactions via
        JDBC
        3.0 Savepoints. The "nestedTransactionAllowed" flag defaults to "false",
        though, as nested transactions will just apply to the JDBC Connection, not
        to the Hibernate Session and its cached objects."

        ... though I could not find anything about savepoints in Hibernate (neither
        Google nor in source code of Hibernate 3.0)... Are you sure that this
        feature is supported by Hibernate?

        And sure, you can emulate it by accessing the connection object and using
        JDBC there, but in this case you might have problems anyway - it requires
        that before you set savepoint you have to flush everything to database.
        Then
        if you rollback, you have to expunge everything from the Hibernate's cache
        to force it to load data from the disk.

        Roman




        Yahoo! Groups Links
      • David Jencks
        ... I don t wish to say bad things about Hibernate or Spring but after looking at some Spring code I think it is possible that one or both of these projects
        Message 3 of 7 , Feb 3, 2006
        • 0 Attachment
          On Feb 1, 2006, at 7:19 AM, Roman Rokytskyy wrote:

          >> Do you know if there anything I need to "turn it on" when using
          >> Hibernate?
          >> The HibernateTransactionManager doesn't seem to support it, but
          >> Hibernate
          >> site says it is dependent on the underlying JDBC driver?
          >
          > After short googling I found Javadoc for
          > HibernateTransactionManager in
          > Spring Framework:
          >
          > "On JDBC 3.0, this transaction manager supports nested transactions
          > via JDBC
          > 3.0 Savepoints. The "nestedTransactionAllowed" flag defaults to
          > "false",
          > though, as nested transactions will just apply to the JDBC
          > Connection, not
          > to the Hibernate Session and its cached objects."
          >
          > ... though I could not find anything about savepoints in Hibernate
          > (neither
          > Google nor in source code of Hibernate 3.0)... Are you sure that this
          > feature is supported by Hibernate?

          I don't wish to say bad things about Hibernate or Spring but after
          looking at some Spring code I think it is possible that one or both
          of these projects have confused nested transactions (often
          implemented with and pretty much equivalent to savepoints) with xa
          suspend/resume behavior used in e.g. ejb RequiresNew CMT policy. Of
          course these are not in any way equivalent. Hopefully I have
          misunderstood the Spring code I was looking at.

          thanks
          david jencks

          >
          > And sure, you can emulate it by accessing the connection object and
          > using
          > JDBC there, but in this case you might have problems anyway - it
          > requires
          > that before you set savepoint you have to flush everything to
          > database. Then
          > if you rollback, you have to expunge everything from the
          > Hibernate's cache
          > to force it to load data from the disk.
          >
          > Roman
          >
          >
          >
          >
          > Yahoo! Groups Links
          >
          >
          >
          >
          >
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.