Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.impl.jdbc
Class EmbedSavepoint30  view EmbedSavepoint30 download EmbedSavepoint30.java

java.lang.Object
  extended byorg.apache.derby.impl.jdbc.ConnectionChild
      extended byorg.apache.derby.impl.jdbc.EmbedSavepoint30
All Implemented Interfaces:
java.sql.Savepoint

final class EmbedSavepoint30
extends ConnectionChild
implements java.sql.Savepoint

This class implements the Savepoint interface from JDBC3.0 This allows to set, release, or rollback a transaction to designated Savepoints. Savepoints provide finer-grained control of transactions by marking intermediate points within a transaction. Once a savepoint has been set, the transaction can be rolled back to that savepoint without affecting preceding work.

Supports


Field Summary
protected static boolean CLOSE
           
protected  org.apache.derby.jdbc.InternalDriver factory
          Factory for JDBC objects to be created.
protected  EmbedConnection localConn
           
protected static boolean NOCLOSE
           
private  int savepointID
           
private  java.lang.String savepointName
           
 
Constructor Summary
(package private) EmbedSavepoint30(EmbedConnection conn, java.lang.String name)
           
 
Method Summary
protected  void commitIfAutoCommit()
          Perform a commit if autocommit is enabled.
protected  void commitIfNeeded()
          Perform a commit if one is needed.
protected  java.util.Calendar getCal()
          Get and save a unique calendar object for this JDBC object.
protected  java.lang.Object getConnectionSynchronization()
          Return an object to be used for connection synchronization.
 org.apache.derby.iapi.services.context.ContextManager getContextManager()
           
 org.apache.derby.iapi.db.Database getDatabase()
           
protected  EmbedConnection getEmbedConnection()
          Return a reference to the EmbedConnection
(package private)  java.lang.String getInternalName()
           
 int getSavepointId()
          Retrieves the generated ID for the savepoint that this Savepoint object represents.
 java.lang.String getSavepointName()
          Retrieves the name of the savepoint that this Savepoint object represents.
protected  java.sql.SQLException handleException(java.lang.Throwable t)
          Handle any exception.
protected  java.sql.SQLException handleException(java.lang.Throwable t, boolean close)
          Handle any exception.
protected  void needCommit()
          If Autocommit is on, note that a commit is needed.
protected  java.sql.SQLException newSQLException(java.lang.String messageId)
           
protected  java.sql.SQLException newSQLException(java.lang.String messageId, java.lang.Object arg1)
           
protected  java.sql.SQLException newSQLException(java.lang.String messageId, java.lang.Object arg1, java.lang.Object arg2)
           
protected  void restoreContextStack()
          Setup the context stack (a.k.a.
(package private)  boolean sameConnection(EmbedConnection con)
           
protected  void setupContextStack()
          Setup the context stack (a.k.a.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

savepointName

private final java.lang.String savepointName

savepointID

private final int savepointID

CLOSE

protected static final boolean CLOSE
See Also:
Constant Field Values

NOCLOSE

protected static final boolean NOCLOSE
See Also:
Constant Field Values

localConn

protected EmbedConnection localConn

factory

protected final org.apache.derby.jdbc.InternalDriver factory
Factory for JDBC objects to be created.

Constructor Detail

EmbedSavepoint30

EmbedSavepoint30(EmbedConnection conn,
                 java.lang.String name)
           throws org.apache.derby.iapi.error.StandardException
Method Detail

getSavepointId

public int getSavepointId()
                   throws java.sql.SQLException
Retrieves the generated ID for the savepoint that this Savepoint object represents.

Specified by:
getSavepointId in interface java.sql.Savepoint

getSavepointName

public java.lang.String getSavepointName()
                                  throws java.sql.SQLException
Retrieves the name of the savepoint that this Savepoint object represents.

Specified by:
getSavepointName in interface java.sql.Savepoint

getInternalName

java.lang.String getInternalName()

sameConnection

boolean sameConnection(EmbedConnection con)

getEmbedConnection

protected final EmbedConnection getEmbedConnection()
Return a reference to the EmbedConnection


getConnectionSynchronization

protected final java.lang.Object getConnectionSynchronization()
Return an object to be used for connection synchronization.


handleException

protected final java.sql.SQLException handleException(java.lang.Throwable t)
                                               throws java.sql.SQLException
Handle any exception.


handleException

protected final java.sql.SQLException handleException(java.lang.Throwable t,
                                                      boolean close)
                                               throws java.sql.SQLException
Handle any exception.


needCommit

protected final void needCommit()
If Autocommit is on, note that a commit is needed.


commitIfNeeded

protected final void commitIfNeeded()
                             throws java.sql.SQLException
Perform a commit if one is needed.


commitIfAutoCommit

protected final void commitIfAutoCommit()
                                 throws java.sql.SQLException
Perform a commit if autocommit is enabled.


setupContextStack

protected final void setupContextStack()
                                throws java.sql.SQLException
Setup the context stack (a.k.a. context manager) for this connection.


restoreContextStack

protected final void restoreContextStack()
                                  throws java.sql.SQLException
Setup the context stack (a.k.a. context manager) for this connection.


getContextManager

public org.apache.derby.iapi.services.context.ContextManager getContextManager()

getDatabase

public org.apache.derby.iapi.db.Database getDatabase()

getCal

protected java.util.Calendar getCal()
Get and save a unique calendar object for this JDBC object. No need to synchronize because multiple threads should not be using a single JDBC object. Even if they do there is only a small window where each would get its own Calendar for a single call.


newSQLException

protected java.sql.SQLException newSQLException(java.lang.String messageId)

newSQLException

protected java.sql.SQLException newSQLException(java.lang.String messageId,
                                                java.lang.Object arg1)

newSQLException

protected java.sql.SQLException newSQLException(java.lang.String messageId,
                                                java.lang.Object arg1,
                                                java.lang.Object arg2)