|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgoldengate.common.database.DbSession
public class DbSession
Class to handle session with the SGBD
Field Summary | |
---|---|
DbAdmin |
admin
DbAdmin referent object |
boolean |
autoCommit
Is this session using AutoCommit (true by default) |
Connection |
conn
The internal connection |
long |
internalId
Internal Id |
boolean |
isDisconnected
To be used when a local Channel is over |
boolean |
isReadOnly
Is this connection Read Only |
int |
nbThread
Number of threads using this connection |
Constructor Summary | |
---|---|
DbSession(Connection connext,
boolean isReadOnly)
Create a session and connect the current object to the connect object given as parameter. |
|
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. |
|
DbSession(String server,
String user,
String passwd,
boolean isReadOnly)
Create a session and connect the current object to the server using the string with the form for mysql for instance jdbc:type://[host:port],[failoverhost:port] ... |
|
DbSession(String server,
String user,
String passwd,
boolean isReadOnly,
boolean autoCommit)
Create a session and connect the current object to the server using the string with the form for mysql for instance jdbc:type://[host:port],[failoverhost:port] ... |
Method Summary | |
---|---|
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) |
static void |
error(SQLException ex)
Print the error from SQLException |
DbAdmin |
getAdmin()
|
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 |
void |
setAdmin(DbAdmin admin)
|
void |
setAutoCommit(boolean autoCommit)
Change the autocommit feature |
void |
useConnection()
To be called when a client will start to use this DbSession (once by client) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public DbAdmin admin
public Connection conn
public boolean isReadOnly
public boolean autoCommit
public long internalId
public int nbThread
public boolean isDisconnected
Constructor Detail |
---|
public DbSession(Connection connext, boolean isReadOnly) throws GoldenGateDatabaseNoConnectionException
connext
- isReadOnly
-
GoldenGateDatabaseNoConnectionException
public DbSession(String server, String user, String passwd, boolean isReadOnly) throws GoldenGateDatabaseNoConnectionException
server
- user
- passwd
- isReadOnly
-
GoldenGateDatabaseSqlException
GoldenGateDatabaseNoConnectionException
public DbSession(DbAdmin admin, boolean isReadOnly) throws GoldenGateDatabaseNoConnectionException
admin
- isReadOnly
-
GoldenGateDatabaseSqlException
GoldenGateDatabaseNoConnectionException
public DbSession(String server, String user, String passwd, boolean isReadOnly, boolean autoCommit) throws GoldenGateDatabaseNoConnectionException
server
- user
- passwd
- isReadOnly
- autoCommit
-
GoldenGateDatabaseSqlException
GoldenGateDatabaseNoConnectionException
public DbSession(DbAdmin admin, boolean isReadOnly, boolean autoCommit) throws GoldenGateDatabaseNoConnectionException
admin
- isReadOnly
- autoCommit
-
GoldenGateDatabaseSqlException
GoldenGateDatabaseNoConnectionException
Method Detail |
---|
public void setAutoCommit(boolean autoCommit) throws GoldenGateDatabaseNoConnectionException
autoCommit
-
GoldenGateDatabaseNoConnectionException
public DbAdmin getAdmin()
public void setAdmin(DbAdmin admin)
admin
- the admin to setpublic static void error(SQLException ex)
ex
- public void useConnection()
public void endUseConnection()
public void disconnect()
public void checkConnection() throws GoldenGateDatabaseNoConnectionException
GoldenGateDatabaseNoConnectionException
public boolean checkConnectionNoException()
public void addLongTermPreparedStatement(DbPreparedStatement longterm)
longterm
- public void recreateLongTermPreparedStatements() throws GoldenGateDatabaseNoConnectionException, GoldenGateDatabaseSqlException
GoldenGateDatabaseNoConnectionException
GoldenGateDatabaseSqlException
public void removeLongTermPreparedStatements()
public void removeLongTermPreparedStatements(DbPreparedStatement longterm)
longterm
- public void commit() throws GoldenGateDatabaseSqlException, GoldenGateDatabaseNoConnectionException
GoldenGateDatabaseSqlException
GoldenGateDatabaseNoConnectionException
public void rollback(Savepoint savepoint) throws GoldenGateDatabaseNoConnectionException, GoldenGateDatabaseSqlException
savepoint
-
GoldenGateDatabaseNoConnectionException
GoldenGateDatabaseSqlException
public Savepoint savepoint() throws GoldenGateDatabaseNoConnectionException, GoldenGateDatabaseSqlException
GoldenGateDatabaseNoConnectionException
GoldenGateDatabaseSqlException
public void releaseSavepoint(Savepoint savepoint) throws GoldenGateDatabaseNoConnectionException, GoldenGateDatabaseSqlException
savepoint
-
GoldenGateDatabaseNoConnectionException
GoldenGateDatabaseSqlException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |