Package org.firebirdsql.jdbc
Class InternalTransactionCoordinator.AbstractTransactionCoordinator
- java.lang.Object
-
- org.firebirdsql.jdbc.InternalTransactionCoordinator.AbstractTransactionCoordinator
-
- All Implemented Interfaces:
FBObjectListener.BlobListener,FBObjectListener.StatementListener
- Enclosing class:
- InternalTransactionCoordinator
public abstract static class InternalTransactionCoordinator.AbstractTransactionCoordinator extends java.lang.Object implements FBObjectListener.StatementListener, FBObjectListener.BlobListener
-
-
Field Summary
Fields Modifier and Type Field Description protected FBConnectionconnectionprotected FBLocalTransactionlocalTransactionprotected java.util.Collection<FBStatement>statements
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractTransactionCoordinator(FBConnection connection, FBLocalTransaction localTransaction)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidcommit()protected voidcompleteStatements(CompletionReason reason)voidensureTransaction()FBConnectiongetConnection()Get the connection which owns this coordinator.protected java.util.Collection<FBStatement>getStatements()abstract voidrollback()protected voidsetStatements(java.util.Collection<FBStatement> statements)voidstatementCompleted(FBStatement stmt)Notify the listener that statement is completed.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.firebirdsql.jdbc.FBObjectListener.BlobListener
executionCompleted, executionStarted
-
Methods inherited from interface org.firebirdsql.jdbc.FBObjectListener.StatementListener
executionStarted, statementClosed, statementCompleted
-
-
-
-
Field Detail
-
localTransaction
protected final FBLocalTransaction localTransaction
-
connection
protected final FBConnection connection
-
statements
protected final java.util.Collection<FBStatement> statements
-
-
Constructor Detail
-
AbstractTransactionCoordinator
protected AbstractTransactionCoordinator(FBConnection connection, FBLocalTransaction localTransaction)
-
-
Method Detail
-
getConnection
public final FBConnection getConnection() throws java.sql.SQLException
Get the connection which owns this coordinator.- Specified by:
getConnectionin interfaceFBObjectListener.StatementListener- Returns:
- instance of
FBConnection - Throws:
java.sql.SQLException- if something went wrong.
-
getStatements
protected final java.util.Collection<FBStatement> getStatements()
-
setStatements
protected final void setStatements(java.util.Collection<FBStatement> statements)
-
completeStatements
protected void completeStatements(CompletionReason reason) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
ensureTransaction
public void ensureTransaction() throws java.sql.SQLException- Throws:
java.sql.SQLException
-
commit
public abstract void commit() throws java.sql.SQLException- Throws:
java.sql.SQLException
-
rollback
public abstract void rollback() throws java.sql.SQLException- Throws:
java.sql.SQLException
-
statementCompleted
public final void statementCompleted(FBStatement stmt) throws java.sql.SQLException
Description copied from interface:FBObjectListener.StatementListenerNotify the listener that statement is completed. This is shortcut method forstatementCompleted(AbstractStatement, true).- Specified by:
statementCompletedin interfaceFBObjectListener.StatementListener- Parameters:
stmt- statement that was completed.- Throws:
java.sql.SQLException
-
-