Package org.h2.jdbc

Class JdbcSavepoint

  • All Implemented Interfaces:
    java.sql.Savepoint

    public final class JdbcSavepoint
    extends TraceObject
    implements java.sql.Savepoint
    A savepoint is a point inside a transaction to where a transaction can be rolled back. The tasks that where done before the savepoint are not rolled back in this case.
    • Field Detail

      • SYSTEM_SAVEPOINT_PREFIX

        private static final java.lang.String SYSTEM_SAVEPOINT_PREFIX
        See Also:
        Constant Field Values
      • savepointId

        private final int savepointId
      • name

        private final java.lang.String name
    • Constructor Detail

      • JdbcSavepoint

        JdbcSavepoint​(JdbcConnection conn,
                      int savepointId,
                      java.lang.String name,
                      Trace trace,
                      int id)
    • Method Detail

      • release

        void release()
        Release this savepoint. This method only set the connection to null and does not execute a statement.
      • getName

        static java.lang.String getName​(java.lang.String name,
                                        int id)
        Get the savepoint name for this name or id. If the name is null, the id is used.
        Parameters:
        name - the name (may be null)
        id - the id
        Returns:
        the savepoint name
      • rollback

        void rollback()
        Roll back to this savepoint.
      • checkValid

        private void checkValid()
      • getSavepointId

        public int getSavepointId()
                           throws java.sql.SQLException
        Get the generated id of this savepoint.
        Specified by:
        getSavepointId in interface java.sql.Savepoint
        Returns:
        the id
        Throws:
        java.sql.SQLException
      • getSavepointName

        public java.lang.String getSavepointName()
                                          throws java.sql.SQLException
        Get the name of this savepoint.
        Specified by:
        getSavepointName in interface java.sql.Savepoint
        Returns:
        the name
        Throws:
        java.sql.SQLException
      • toString

        public java.lang.String toString()
        INTERNAL
        Overrides:
        toString in class java.lang.Object