public interface ISession
An ISession is a decorator around an SeConnection, ensuring the SeConnection is not
hit by two concurrent threads while at the same time participating in a connection pool where more than one thread can reclaim usage of the SeConnection.
Each piece of code that needs access to an SeConnection, either directly or indirectly
(for example, by accessing an SeStreamOp like in SeQuery.fetch() or new
SeLayer(connection), needs to do so inside the body of a Command, and issue the command
through issue(Command).
| Modifier and Type | Method and Description |
|---|---|
void |
close(SeState state) |
void |
close(SeStreamOp stream) |
void |
commitTransaction()
Commits the current transaction.
|
SeQuery |
createAndExecuteQuery(String[] propertyNames,
SeSqlConstruct sql) |
SeState |
createChildState(long parentStateId) |
SeDelete |
createSeDelete() |
SeInsert |
createSeInsert() |
SeRegistration |
createSeRegistration(String typeName) |
SeTable |
createSeTable(String qualifiedName)
Creates an SeTable named
qualifiedName |
SeUpdate |
createSeUpdate() |
SeState |
createState(SeObjectId stateId) |
SeColumnDefinition[] |
describe(SeTable table) |
SeColumnDefinition[] |
describe(String tableName) |
void |
dispose()
Return to the pool (may not close the internal connection, depends on pool settings).
|
boolean |
equals(Object other)
Compares for reference equality
|
SdeRow |
fetch(SeQuery query)
Issues a command that fetches a row from an already executed SeQuery and returns the
SdeRow object with its contents. |
SdeRow |
fetch(SeQuery seQuery,
SdeRow currentRow) |
String |
getDatabaseName() |
SeDBMSInfo |
getDBMSInfo() |
SeLayer |
getLayer(String layerName) |
List<SeLayer> |
getLayers()
Returns the live list of layers, not the cached ones, so it may pick up the differences in
the database.
|
SeRasterColumn |
getRasterColumn(String rasterName) |
List<String> |
getRasterColumns() |
SeRelease |
getRelease() |
SeTable |
getTable(String tableName) |
String |
getUser() |
int |
hashCode() |
boolean |
isClosed() |
boolean |
isDisposed()
Returns whether this connection is on the connection pool domain or not.
|
<T> T |
issue(Command<T> command)
Executes the given command and returns its result.
|
boolean |
isTransactionActive()
Returns whether a transaction is in progress over this connection
As for any other public method, this one can't be called if
isDisposed() is true. |
SeQuery |
prepareQuery(SeQueryInfo qInfo,
SeFilter[] spatialConstraints,
ArcSdeVersionHandler version) |
void |
rollbackTransaction()
Rolls back the current transaction
When this method returns it is guaranteed that
isTransactionActive() will return
false, regardless of the success of the rollback operation. |
void |
startTransaction()
Starts a transaction over the connection held by this Session
If this method succeeds,
isTransactionActive() will return true afterwards |
void |
testServer()
Performs a session sanity check to avoid stale connections to be returned from the pool.
|
<T> T issue(Command<T> command) throws IOException
command - the command to executeIOException - if an exception occurs handling any ArcSDE resource while executing the
commandvoid testServer()
throws IOException
IOExceptionSeConnection#testServer(long)}boolean isClosed()
boolean isDisposed()
true if this connection has beed returned to the pool and thus cannot be
used, false if its safe to keep using it.SeLayer getLayer(String layerName) throws IOException
IOExceptionSeRasterColumn getRasterColumn(String rasterName) throws IOException
IOExceptionList<String> getRasterColumns() throws IOException
IOExceptionSeTable getTable(String tableName) throws IOException
IOExceptionvoid startTransaction()
throws IOException
If this method succeeds, isTransactionActive() will return true afterwards
IOException#issueStartTransaction(Session)}void commitTransaction()
throws IOException
This method shall only be called from inside a command
IOExceptionboolean isTransactionActive()
As for any other public method, this one can't be called if isDisposed() is true.
void rollbackTransaction()
throws IOException
When this method returns it is guaranteed that isTransactionActive() will return
false, regardless of the success of the rollback operation.
IOExceptionvoid dispose()
throws IllegalStateException
IllegalStateException - if dispose() is called while a transaction is in progressboolean equals(Object other)
List<SeLayer> getLayers() throws IOException
IOExceptionString getUser() throws IOException
IOExceptionSeRelease getRelease()
throws IOException
IOExceptionString getDatabaseName() throws IOException
IOExceptionSeDBMSInfo getDBMSInfo()
throws IOException
IOExceptionSeRegistration createSeRegistration(String typeName) throws IOException
IOExceptionSeTable createSeTable(String qualifiedName) throws IOException
qualifiedName; the layer does not need to exist on the server.qualifiedName - IOExceptionSeInsert createSeInsert()
throws IOException
IOExceptionSeUpdate createSeUpdate()
throws IOException
IOExceptionSeDelete createSeDelete()
throws IOException
IOExceptionSeColumnDefinition[] describe(String tableName) throws IOException
IOExceptionSeColumnDefinition[] describe(SeTable table)
throws IOException
IOExceptionSdeRow fetch(SeQuery query) throws IOException
SdeRow object with its contents.
The point in returning an SdeRow instead of a plain SeRow is that the
former prefetches the row values and this can be freely used outside a Command.
Otherwise the SeRow should only be used inside a command as accessing its values implies
using the connection.
query - IOExceptionSdeRow fetch(SeQuery seQuery, SdeRow currentRow) throws IOException
IOExceptionvoid close(SeState state)
throws IOException
IOExceptionvoid close(SeStreamOp stream)
throws IOException
IOExceptionSeState createState(SeObjectId stateId)
throws IOException
IOExceptionSeQuery createAndExecuteQuery(String[] propertyNames, SeSqlConstruct sql) throws IOException
IOExceptionSeState createChildState(long parentStateId)
throws IOException
IOExceptionSeQuery prepareQuery(SeQueryInfo qInfo,
SeFilter[] spatialConstraints,
ArcSdeVersionHandler version)
throws IOException
IOExceptionCopyright © 1996–2019 Geotools. All rights reserved.