public class DbSession extends Object
Constructor and Description |
---|
DbSession(DbAdmin admin,
boolean isReadOnly)
Create a session and connect the current object to the server using the
DbAdmin object.
|
DbSession(DbAdmin admin,
boolean isReadOnly,
boolean autoCommit)
Create a session and connect the current object to the server using the
DbAdmin object.
|
Modifier and Type | Method and Description |
---|---|
void |
addLongTermPreparedStatement(DbPreparedStatement longterm)
Add a Long Term PreparedStatement
|
void |
checkConnection()
Check the connection to the Database and try to reopen it if possible
|
boolean |
checkConnectionNoException() |
void |
commit()
Commit everything
|
void |
disconnect()
Close the connection
|
void |
endUseConnection()
To be called when a client will stop to use this DbSession (once by
client)
|
void |
enUseConnectionNoDisconnect()
To be called when a client will stop to use this DbSession (once by
client).
|
boolean |
equals(Object o) |
void |
forceDisconnect()
Force the close of the connection
|
DbAdmin |
getAdmin() |
Connection |
getConn() |
GUID |
getInternalId() |
int |
hashCode() |
boolean |
isAutoCommit() |
boolean |
isDisActive() |
boolean |
isReadOnly() |
void |
recreateLongTermPreparedStatements()
Due to a reconnection, recreate all associated long term
PreparedStatements
|
void |
releaseSavepoint(Savepoint savepoint)
Release the savepoint
|
void |
removeLongTermPreparedStatements()
Remove all Long Term PreparedStatements (closing connection)
|
void |
removeLongTermPreparedStatements(DbPreparedStatement longterm)
Remove one Long Term PreparedStatement
|
void |
rollback(Savepoint savepoint)
Rollback from the savepoint or the last set if null
|
Savepoint |
savepoint()
Make a savepoint
|
protected void |
setAdmin(DbAdmin admin) |
void |
setAutoCommit(boolean autoCommit)
Change the autocommit feature
|
void |
setConn(Connection conn) |
void |
setDisActive(boolean isDisActive) |
void |
setReadOnly(boolean isReadOnly) |
void |
useConnection()
To be called when a client will start to use this DbSession (once by
client)
|
public DbSession(DbAdmin admin, boolean isReadOnly) throws WaarpDatabaseNoConnectionException
If the initialize is not call before, call it with the default value.
admin
- isReadOnly
- WaarpDatabaseSqlException
WaarpDatabaseNoConnectionException
public DbSession(DbAdmin admin, boolean isReadOnly, boolean autoCommit) throws WaarpDatabaseNoConnectionException
If the initialize is not call before, call it with the default value.
admin
- isReadOnly
- autoCommit
- WaarpDatabaseSqlException
WaarpDatabaseNoConnectionException
public final void setAutoCommit(boolean autoCommit) throws WaarpDatabaseNoConnectionException
autoCommit
- WaarpDatabaseNoConnectionException
public final DbAdmin getAdmin()
protected final void setAdmin(DbAdmin admin)
admin
- the admin to setpublic final void useConnection()
public final void endUseConnection()
public final void enUseConnectionNoDisconnect()
public final void forceDisconnect()
public final void disconnect()
public final void checkConnection() throws WaarpDatabaseNoConnectionException
public final boolean checkConnectionNoException()
public final void addLongTermPreparedStatement(DbPreparedStatement longterm)
longterm
- public final void recreateLongTermPreparedStatements() throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
public final void removeLongTermPreparedStatements()
public final void removeLongTermPreparedStatements(DbPreparedStatement longterm)
longterm
- public final void commit() throws WaarpDatabaseSqlException, WaarpDatabaseNoConnectionException
public final void rollback(Savepoint savepoint) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
savepoint
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public final Savepoint savepoint() throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public final void releaseSavepoint(Savepoint savepoint) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
savepoint
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public final boolean isReadOnly()
public final void setReadOnly(boolean isReadOnly)
isReadOnly
- the isReadOnly to setpublic final boolean isAutoCommit()
public final Connection getConn()
public final void setConn(Connection conn)
conn
- the conn to setpublic final GUID getInternalId()
public final boolean isDisActive()
public final void setDisActive(boolean isDisActive)
isDisActive
- the isDisActive to setCopyright © 2009–2022 Waarp. All rights reserved.