public class Session
extends java.lang.Object
implements com.marklogic.xcc.Session
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
XQUERY_VERSION_1_0_ML |
| Constructor and Description |
|---|
Session(Connection conn,
com.marklogic.xcc.Session session) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
commit() |
void |
deleteCollection(java.lang.String uri) |
void |
deleteDocument(java.lang.String uri) |
boolean |
existsDocument(java.lang.String uri) |
java.math.BigInteger[] |
forestNamesToIds(java.lang.String[] names) |
int |
getCachedTxnTimeout() |
java.net.URI |
getConnectionUri() |
com.marklogic.xcc.ContentbaseMetaData |
getContentbaseMetaData() |
java.lang.String |
getContentBaseName() |
Connection |
getContentSource() |
long |
getCount() |
java.math.BigInteger |
getCurrentServerPointInTime() |
com.marklogic.xcc.RequestOptions |
getDefaultRequestOptions() |
com.marklogic.xcc.RequestOptions |
getEffectiveRequestOptions() |
java.util.Map<java.lang.String,java.math.BigInteger> |
getForestMap() |
java.util.logging.Logger |
getLogger() |
com.marklogic.xcc.Session.TransactionMode |
getTransactionMode()
Deprecated.
|
int |
getTransactionTimeout()
Get the current transaction timeout.
|
com.marklogic.xcc.Session.Update |
getUpdate() |
com.marklogic.xcc.UserCredentials |
getUserCredentials() |
java.lang.Object |
getUserObject() |
javax.transaction.xa.XAResource |
getXAResource()
Returns an instance of the XAResource interface, specific to this Session object.
|
void |
insertContent(com.marklogic.xcc.Content content) |
void |
insertContent(com.marklogic.xcc.Content[] content) |
java.util.List<com.marklogic.xcc.exceptions.RequestException> |
insertContentCollectErrors(com.marklogic.xcc.Content[] content) |
boolean |
isAutoCommit() |
boolean |
isClosed() |
com.marklogic.xcc.AdhocQuery |
newAdhocQuery(java.lang.String queryText) |
com.marklogic.xcc.AdhocQuery |
newAdhocQuery(java.lang.String queryText,
com.marklogic.xcc.RequestOptions options) |
com.marklogic.xcc.ModuleInvoke |
newModuleInvoke(java.lang.String moduleUri) |
com.marklogic.xcc.ModuleInvoke |
newModuleInvoke(java.lang.String moduleUri,
com.marklogic.xcc.RequestOptions options) |
com.marklogic.xcc.ModuleSpawn |
newModuleSpawn(java.lang.String moduleUri) |
com.marklogic.xcc.ModuleSpawn |
newModuleSpawn(java.lang.String moduleUri,
com.marklogic.xcc.RequestOptions options) |
void |
rollback() |
void |
setAutoCommit(boolean autoCommit) |
void |
setDefaultRequestOptions(com.marklogic.xcc.RequestOptions options) |
void |
setDocumentProperties(java.lang.String uri,
java.lang.String xmlString) |
void |
setLogger(java.util.logging.Logger logger) |
void |
setTransactionMode(com.marklogic.xcc.Session.TransactionMode mode)
Deprecated.
|
void |
setTransactionTimeout(int seconds)
Sets the timeout for transactions
|
void |
setUpdate(com.marklogic.xcc.Session.Update update) |
void |
setUserObject(java.lang.Object userObject) |
com.marklogic.xcc.ResultSequence |
submitRequest(com.marklogic.xcc.Request request) |
public static final java.lang.String XQUERY_VERSION_1_0_ML
public Session(Connection conn, com.marklogic.xcc.Session session)
session - public Connection getContentSource()
getContentSource in interface com.marklogic.xcc.Sessionpublic com.marklogic.xcc.UserCredentials getUserCredentials()
getUserCredentials in interface com.marklogic.xcc.Sessionpublic java.lang.String getContentBaseName()
getContentBaseName in interface com.marklogic.xcc.Sessionpublic boolean commit()
throws com.marklogic.xcc.exceptions.RequestException
commit in interface com.marklogic.xcc.Sessioncom.marklogic.xcc.exceptions.RequestExceptionpublic void rollback()
throws com.marklogic.xcc.exceptions.RequestException
rollback in interface com.marklogic.xcc.Sessioncom.marklogic.xcc.exceptions.RequestExceptionpublic void close()
close in interface com.marklogic.xcc.Sessionclose in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic boolean isAutoCommit()
isAutoCommit in interface com.marklogic.xcc.Sessionpublic boolean isClosed()
isClosed in interface com.marklogic.xcc.Sessionpublic com.marklogic.xcc.ResultSequence submitRequest(com.marklogic.xcc.Request request)
throws com.marklogic.xcc.exceptions.RequestException
submitRequest in interface com.marklogic.xcc.Sessioncom.marklogic.xcc.exceptions.RequestExceptionpublic com.marklogic.xcc.AdhocQuery newAdhocQuery(java.lang.String queryText,
com.marklogic.xcc.RequestOptions options)
newAdhocQuery in interface com.marklogic.xcc.Sessionpublic com.marklogic.xcc.AdhocQuery newAdhocQuery(java.lang.String queryText)
newAdhocQuery in interface com.marklogic.xcc.Sessionpublic com.marklogic.xcc.ModuleInvoke newModuleInvoke(java.lang.String moduleUri,
com.marklogic.xcc.RequestOptions options)
newModuleInvoke in interface com.marklogic.xcc.Sessionpublic com.marklogic.xcc.ModuleInvoke newModuleInvoke(java.lang.String moduleUri)
newModuleInvoke in interface com.marklogic.xcc.Sessionpublic com.marklogic.xcc.ModuleSpawn newModuleSpawn(java.lang.String moduleUri,
com.marklogic.xcc.RequestOptions options)
newModuleSpawn in interface com.marklogic.xcc.Sessionpublic com.marklogic.xcc.ModuleSpawn newModuleSpawn(java.lang.String moduleUri)
newModuleSpawn in interface com.marklogic.xcc.Sessionpublic void insertContent(com.marklogic.xcc.Content content)
throws com.marklogic.xcc.exceptions.RequestException
insertContent in interface com.marklogic.xcc.Sessioncom.marklogic.xcc.exceptions.RequestExceptionpublic void insertContent(com.marklogic.xcc.Content[] content)
throws com.marklogic.xcc.exceptions.RequestException
insertContent in interface com.marklogic.xcc.Sessioncom.marklogic.xcc.exceptions.RequestExceptionpublic java.util.List<com.marklogic.xcc.exceptions.RequestException> insertContentCollectErrors(com.marklogic.xcc.Content[] content)
insertContentCollectErrors in interface com.marklogic.xcc.Sessionpublic com.marklogic.xcc.ContentbaseMetaData getContentbaseMetaData()
getContentbaseMetaData in interface com.marklogic.xcc.Sessionpublic void setAutoCommit(boolean autoCommit)
setAutoCommit in interface com.marklogic.xcc.Sessionpublic void setDefaultRequestOptions(com.marklogic.xcc.RequestOptions options)
setDefaultRequestOptions in interface com.marklogic.xcc.Sessionpublic com.marklogic.xcc.RequestOptions getDefaultRequestOptions()
getDefaultRequestOptions in interface com.marklogic.xcc.Sessionpublic void setUpdate(com.marklogic.xcc.Session.Update update)
setUpdate in interface com.marklogic.xcc.Sessionpublic com.marklogic.xcc.Session.Update getUpdate()
getUpdate in interface com.marklogic.xcc.Sessionpublic com.marklogic.xcc.RequestOptions getEffectiveRequestOptions()
getEffectiveRequestOptions in interface com.marklogic.xcc.Sessionpublic java.math.BigInteger getCurrentServerPointInTime()
throws com.marklogic.xcc.exceptions.RequestException
getCurrentServerPointInTime in interface com.marklogic.xcc.Sessioncom.marklogic.xcc.exceptions.RequestExceptionpublic java.util.logging.Logger getLogger()
getLogger in interface com.marklogic.xcc.Sessionpublic void setLogger(java.util.logging.Logger logger)
setLogger in interface com.marklogic.xcc.Sessionpublic void setUserObject(java.lang.Object userObject)
setUserObject in interface com.marklogic.xcc.Sessionpublic java.lang.Object getUserObject()
getUserObject in interface com.marklogic.xcc.Sessionpublic boolean existsDocument(java.lang.String uri)
throws com.marklogic.xcc.exceptions.XccException
com.marklogic.xcc.exceptions.XccExceptionpublic long getCount()
throws com.marklogic.xcc.exceptions.XccException
com.marklogic.xcc.exceptions.XccExceptionpublic void deleteDocument(java.lang.String uri)
throws com.marklogic.xcc.exceptions.XccException
uri - com.marklogic.xcc.exceptions.XccExceptionpublic void deleteCollection(java.lang.String uri)
throws com.marklogic.xcc.exceptions.XccException
uri - com.marklogic.xcc.exceptions.XccExceptionpublic void setDocumentProperties(java.lang.String uri,
java.lang.String xmlString)
throws com.marklogic.xcc.exceptions.XccException
uri - xmlString - com.marklogic.xcc.exceptions.XccExceptionpublic java.util.Map<java.lang.String,java.math.BigInteger> getForestMap()
throws com.marklogic.xcc.exceptions.XccException
com.marklogic.xcc.exceptions.XccExceptionpublic java.math.BigInteger[] forestNamesToIds(java.lang.String[] names)
throws com.marklogic.xcc.exceptions.XccException
names - com.marklogic.xcc.exceptions.XccExceptionpublic java.net.URI getConnectionUri()
getConnectionUri in interface com.marklogic.xcc.Session@Deprecated public void setTransactionMode(com.marklogic.xcc.Session.TransactionMode mode)
Sets the transaction mode to the given value. The initial value is TransactionMode.AUTO.
If the transaction mode is TransactionMode.AUTO, a new transaction is created for every request, and committed (or rolled back) at the end of that request. The type of transaction created is determined automatically by query analysis.
If transaction mode is TransactionMode.QUERY or TransactionMode.UPDATE, requests are grouped under transactions bounded by calls to Session.commit() or Session.rollback(). If transaction mode is TransactionMode.QUERY, then a read-only query transaction is created to group requests. If transaction mode is TransactionMode.UPDATE, then a locking update transaction is created. If an updating request is executed under a read-only TransactionMode.QUERY transaction, a RequestException is thrown.
Calling setTransactionMode() while a transaction is active has no effect on the current transaction.
setTransactionMode in interface com.marklogic.xcc.Sessionmode - The new transaction mode@Deprecated public com.marklogic.xcc.Session.TransactionMode getTransactionMode()
getTransactionMode in interface com.marklogic.xcc.Sessionpublic void setTransactionTimeout(int seconds)
throws com.marklogic.xcc.exceptions.RequestException
setTransactionTimeout in interface com.marklogic.xcc.Sessionseconds - The number of seconds before the transaction times outcom.marklogic.xcc.exceptions.RequestException - If there is a problem communicating with the server.public int getTransactionTimeout()
throws com.marklogic.xcc.exceptions.RequestException
getTransactionTimeout in interface com.marklogic.xcc.Sessioncom.marklogic.xcc.exceptions.RequestException - If there is a problem communicating with the server.public javax.transaction.xa.XAResource getXAResource()
Returns an instance of the XAResource interface, specific to this Session object. This can be used to take part in JTA distributed transactions using an implementation of javax.transaction.TransactionManager.
getXAResource in interface com.marklogic.xcc.Sessionpublic int getCachedTxnTimeout()
getCachedTxnTimeout in interface com.marklogic.xcc.Session