public class MultiPluginTransaction extends Transaction
COMMITTED, OPENED, ROLLEDBACK
Constructor and Description |
---|
MultiPluginTransaction()
Constructor
|
MultiPluginTransaction(Plugin plugin)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
commit()
Commit the transaction
|
void |
decrementNbTransactionsOpened()
Decrement the number of transactions by one.
|
void |
executeStatement()
Execute the current statement
|
int |
getNbTransactionsOpened()
Get the number of transactions that plugins tried to open simultaneously on the same pool.
|
void |
incrementNbTransactionsOpened()
Increment the number of transactions by one.
|
PreparedStatement |
prepareStatement(String strSQL)
Gets a prepared statement
|
PreparedStatement |
prepareStatement(String strSQL,
boolean bLogQueries)
Gets a prepared statement
|
PreparedStatement |
prepareStatement(String strSQL,
Integer autoGeneratedKeys)
Gets a prepared statement
|
PreparedStatement |
prepareStatement(String strSQL,
Integer autoGeneratedKeys,
boolean bLogQueries)
Gets a prepared statement
|
void |
rollback(Exception e)
Rollback the transaction
|
getStatement, getStatus, rollback
public MultiPluginTransaction()
public MultiPluginTransaction(Plugin plugin)
plugin
- The plugin owner of the transactionpublic int getNbTransactionsOpened()
public void incrementNbTransactionsOpened()
getNbTransactionsOpened()
for more details.public void decrementNbTransactionsOpened()
getNbTransactionsOpened()
for more details.public PreparedStatement prepareStatement(String strSQL, boolean bLogQueries) throws SQLException
prepareStatement
in class Transaction
strSQL
- The SQL statementSQLException
- If an SQL error occurspublic PreparedStatement prepareStatement(String strSQL) throws SQLException
prepareStatement
in class Transaction
strSQL
- The SQL statementSQLException
- If an SQL error occurspublic PreparedStatement prepareStatement(String strSQL, Integer autoGeneratedKeys) throws SQLException
prepareStatement
in class Transaction
strSQL
- The SQL statementSQLException
- If an SQL error occurspublic PreparedStatement prepareStatement(String strSQL, Integer autoGeneratedKeys, boolean bLogQueries) throws SQLException
prepareStatement
in class Transaction
strSQL
- The SQL statementautoGeneratedKeys
- a flag indicating whether auto-generated keys should be returned; For example one of Statement.RETURN_GENERATED_KEYS
or
Statement.NO_GENERATED_KEYS
. See PreparedStatement#prepareStatement(String, int)
SQLException
- If an SQL error occurspublic void executeStatement() throws SQLException
executeStatement
in class Transaction
SQLException
- If an SQL error occurspublic void commit()
commit
in class Transaction
public void rollback(Exception e)
rollback
in class Transaction
e
- The exception that cause the rollbackCopyright © 2020 City of Paris. All rights reserved.