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
IOException
SeConnection#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
IOException
SeRasterColumn getRasterColumn(String rasterName) throws IOException
IOException
List<String> getRasterColumns() throws IOException
IOException
SeTable getTable(String tableName) throws IOException
IOException
void 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
IOException
boolean 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.
IOException
void dispose() throws IllegalStateException
IllegalStateException
- if dispose() is called while a transaction is in progressboolean equals(Object other)
List<SeLayer> getLayers() throws IOException
IOException
String getUser() throws IOException
IOException
SeRelease getRelease() throws IOException
IOException
String getDatabaseName() throws IOException
IOException
SeDBMSInfo getDBMSInfo() throws IOException
IOException
SeRegistration createSeRegistration(String typeName) throws IOException
IOException
SeTable createSeTable(String qualifiedName) throws IOException
qualifiedName; the layer does not need to exist on the server.
qualifiedName
- IOException
SeInsert createSeInsert() throws IOException
IOException
SeUpdate createSeUpdate() throws IOException
IOException
SeDelete createSeDelete() throws IOException
IOException
SeColumnDefinition[] describe(String tableName) throws IOException
IOException
SeColumnDefinition[] describe(SeTable table) throws IOException
IOException
SdeRow 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
- IOException
SdeRow fetch(SeQuery seQuery, SdeRow currentRow) throws IOException
IOException
void close(SeState state) throws IOException
IOException
void close(SeStreamOp stream) throws IOException
IOException
SeState createState(SeObjectId stateId) throws IOException
IOException
SeQuery createAndExecuteQuery(String[] propertyNames, SeSqlConstruct sql) throws IOException
IOException
SeState createChildState(long parentStateId) throws IOException
IOException
SeQuery prepareQuery(SeQueryInfo qInfo, SeFilter[] spatialConstraints, ArcSdeVersionHandler version) throws IOException
IOException
Copyright © 1996–2019 Geotools. All rights reserved.