MySQL 5.6.14 Source Code Document
|
Classes | |
interface | TransactionState |
Public Member Functions | |
Boolean | found (Object instance) |
Operation | insert (DomainTypeHandler<?> domainTypeHandler, ValueHandler valueHandler) |
Iterable | makePersistentAll (Iterable instances) |
void | deletePersistent (Object object) |
Operation | delete (DomainTypeHandler domainTypeHandler, ValueHandler valueHandler) |
void | deletePersistentAll (Iterable objects) |
int | deletePersistentAll (DomainTypeHandler<?> domainTypeHandler) |
int | deletePersistentAll (ScanOperation op, boolean abort) |
ResultData | selectUnique (DomainTypeHandler domainTypeHandler, ValueHandler keyHandler, BitSet fields) |
void | updatePersistent (Object object) |
Operation | update (DomainTypeHandler domainTypeHandler, ValueHandler valueHandler) |
void | updatePersistentAll (Iterable objects) |
Iterable | savePersistentAll (Iterable instances) |
Transaction | currentTransaction () |
void | close () |
boolean | isClosed () |
void | begin () |
void | commit () |
void | rollback () |
void | startAutoTransaction () |
void | endAutoTransaction () |
void | failAutoTransaction () |
void | setRollbackOnly () |
boolean | getRollbackOnly () |
synchronized< T > DomainTypeHandler< T > | getDomainTypeHandler (Class< T > cls) |
Dictionary | getDictionary () |
boolean | isEnlisted () |
Query | createQuery (Class cls) |
QueryBuilder | getQueryBuilder () |
IndexScanOperation | getIndexScanOperation (Index storeIndex, Table storeTable) |
IndexScanOperation | getIndexScanOperationMultiRange (Index storeIndex, Table storeTable) |
IndexScanOperation | getIndexScanDeleteOperation (Index storeIndex, Table storeTable) |
ScanOperation | getTableScanOperation (Table storeTable) |
ScanOperation | getTableScanDeleteOperation (Table storeTable) |
IndexOperation | getUniqueIndexOperation (Index storeIndex, Table storeTable) |
Operation | getSelectOperation (Table storeTable) |
Operation | getDeleteOperation (Table storeTable) |
IndexOperation | getUniqueIndexDeleteOperation (Index storeIndex, Table storeTable) |
void | flush () |
List | getChangeList () |
void | persist (Object instance) |
void | remove (Object instance) |
void | markModified (StateManager instance) |
void | setPartitionKey (Class<?> domainClass, Object key) |
void | markModified (Object instance, String fieldName) |
void | executeNoCommit (boolean abort, boolean force) |
void | executeNoCommit () |
String | getCoordinatedTransactionId () |
void | setCoordinatedTransactionId (String coordinatedTransactionId) |
void | setLockMode (LockMode lockmode) |
Public Member Functions inherited from com.mysql.clusterj.core.spi.SessionSPI | |
< T > T | initializeFromDatabase (DomainTypeHandler< T > domainTypeHandler, T object, ValueHandler valueHandler, ValueHandler createKeyValueHandler) |
ResultData | selectUnique (DomainTypeHandler<?> domainTypeHandler, ValueHandler keyHandler, BitSet fields) |
Operation | update (DomainTypeHandler<?> domainTypeHandler, ValueHandler valueHandler) |
Operation | delete (DomainTypeHandler<?> domainTypeHandler, ValueHandler valueHandler) |
< T > QueryDomainType< T > | createQueryDomainType (DomainTypeHandler< T > handler) |
Public Member Functions inherited from com.mysql.clusterj.Session | |
< T > T | load (T instance) |
Iterable<?> | makePersistentAll (Iterable<?> instances) |
void | deletePersistentAll (Iterable<?> instances) |
void | updatePersistentAll (Iterable<?> instances) |
Iterable<?> | savePersistentAll (Iterable<?> instances) |
Protected Member Functions | |
void | assertNotClosed () |
void | internalBegin () |
void | internalCommit () |
void | internalRollback () |
void | handleTransactionException () |
synchronized< T > DomainTypeHandler< T > | getDomainTypeHandler (T object) |
Protected Attributes | |
SessionFactoryImpl | factory |
Db | db |
Dictionary | dictionary |
TransactionImpl | transactionImpl |
PartitionKey | partitionKey = null |
boolean | rollbackOnly = false |
ClusterTransaction | clusterTransaction |
String | joinTransactionId = null |
Map | properties |
final int | RESULT_READY = 0 |
final int | SCAN_FINISHED = 1 |
final int | CACHE_EMPTY = 2 |
List< StateManager > | changeList = new ArrayList<StateManager>() |
List< Runnable > | postExecuteOperations = new ArrayList<Runnable>() |
TransactionState | transactionState |
int | nestedAutoTransactionCounter = 0 |
int | numberOfRetries = 5 |
TransactionState | transactionStateNotActive |
TransactionState | transactionStateActive |
TransactionState | transactionStateAutocommit |
This class implements Session, the main user interface to ClusterJ. It also implements SessionSPI, the main component interface.
Definition at line 68 of file SessionImpl.java.
|
inlineprotected |
Assert this session is not yet closed.
Definition at line 714 of file SessionImpl.java.
|
inline |
Begin the current transaction.
Implements com.mysql.clusterj.core.spi.SessionSPI.
Definition at line 724 of file SessionImpl.java.
|
inline |
Close this session and deallocate all resources.
Implements com.mysql.clusterj.Session.
Definition at line 698 of file SessionImpl.java.
|
inline |
Commit the current transaction.
Implements com.mysql.clusterj.core.spi.SessionSPI.
Definition at line 752 of file SessionImpl.java.
|
inline |
Create a query from a class.
cls | the class |
Definition at line 1113 of file SessionImpl.java.
|
inline |
Get the current transaction.
Implements com.mysql.clusterj.Session.
Definition at line 691 of file SessionImpl.java.
|
inline |
Remove an instance from the database. Only the key field(s) are used to identify the instance.
object | the instance to remove from the database |
Implements com.mysql.clusterj.Session.
Definition at line 463 of file SessionImpl.java.
|
inline |
Delete the instances corresponding to the parameters.
objects | the objects to delete |
Definition at line 492 of file SessionImpl.java.
|
inline |
Delete all instances of the parameter domainTypeHandler.
domainTypeHandler | the domainTypeHandler of instances to delete |
Implements com.mysql.clusterj.core.spi.SessionSPI.
Definition at line 512 of file SessionImpl.java.
|
inline |
Delete all instances retrieved by the operation. The operation must have exclusive access to the instances and have the ScanFlag.KEY_INFO flag set.
op | the scan operation |
Implements com.mysql.clusterj.core.spi.SessionSPI.
Definition at line 536 of file SessionImpl.java.
|
inline |
End an auto transaction if it was started. Throw a ClusterJException if there is any problem.
Implements com.mysql.clusterj.core.spi.SessionSPI.
Definition at line 823 of file SessionImpl.java.
|
inline |
Execute any pending operations (insert, delete, update, load) and then perform post-execute operations (for load) via clusterTransaction.postExecuteCallback().
abort | abort this transaction on error |
force | force the operation to be sent immediately |
Implements com.mysql.clusterj.core.spi.SessionSPI.
Definition at line 1343 of file SessionImpl.java.
|
inline |
Execute any pending operations (insert, delete, update, load) and then perform post-execute operations (for load) via clusterTransaction.postExecuteCallback(). Abort the transaction on error. Force the operation to be sent immediately.
Implements com.mysql.clusterj.core.spi.SessionSPI.
Definition at line 1354 of file SessionImpl.java.
|
inline |
Fail an auto transaction if it was started. Throw a ClusterJException if there is any problem.
Implements com.mysql.clusterj.core.spi.SessionSPI.
Definition at line 832 of file SessionImpl.java.
|
inline |
Flush deferred changes to the back end. Inserts, deletes, loads, and updates are sent to the back end.
Implements com.mysql.clusterj.Session.
Definition at line 1275 of file SessionImpl.java.
|
inline |
Was this instance found in the database?
instance | the instance |
Implements com.mysql.clusterj.Session.
Definition at line 353 of file SessionImpl.java.
|
inline |
Return the coordinatedTransactionId of the current transaction. The transaction might not have been enlisted.
Implements com.mysql.clusterj.core.spi.SessionSPI.
Definition at line 1367 of file SessionImpl.java.
Create a delete operation for a table.
storeTable | the table |
Implements com.mysql.clusterj.core.spi.SessionSPI.
Definition at line 1247 of file SessionImpl.java.
|
inlineprotected |
Get the domain type handler for an instance.
object | the instance for which to get the domain type handler |
Definition at line 1047 of file SessionImpl.java.
|
inline |
Get the domain type handler for a class.
cls | the class |
Definition at line 1058 of file SessionImpl.java.
|
inline |
Create an index scan delete operation for an index and table.
storeIndex | the index |
storeTable | the table |
Implements com.mysql.clusterj.core.spi.SessionSPI.
Definition at line 1166 of file SessionImpl.java.
|
inline |
Create an index scan operation for an index and table.
storeIndex | the index |
storeTable | the table |
Implements com.mysql.clusterj.core.spi.SessionSPI.
Definition at line 1132 of file SessionImpl.java.
|
inline |
Create an index scan operation for an index and table to be used for a multi-range scan.
storeIndex | the index |
storeTable | the table |
Implements com.mysql.clusterj.core.spi.SessionSPI.
Definition at line 1149 of file SessionImpl.java.
|
inline |
Get a query builder.
Implements com.mysql.clusterj.Session.
Definition at line 1122 of file SessionImpl.java.
|
inline |
Is the current transaction marked for rollback only?
Implements com.mysql.clusterj.core.spi.SessionSPI.
Definition at line 857 of file SessionImpl.java.
Create a select operation for a table.
storeTable | the table |
Implements com.mysql.clusterj.core.spi.SessionSPI.
Definition at line 1231 of file SessionImpl.java.
|
inline |
Create a table scan delete operation for a table.
storeTable | the table |
Implements com.mysql.clusterj.core.spi.SessionSPI.
Definition at line 1198 of file SessionImpl.java.
|
inline |
Create a table scan operation for a table.
storeTable | the table |
Implements com.mysql.clusterj.core.spi.SessionSPI.
Definition at line 1182 of file SessionImpl.java.
|
inline |
Create an index delete operation for an index and table.
storeIndex | the index |
storeTable | the table |
Implements com.mysql.clusterj.core.spi.SessionSPI.
Definition at line 1264 of file SessionImpl.java.
|
inline |
Create an index operation for an index and table.
storeIndex | the index |
storeTable | the table |
Implements com.mysql.clusterj.core.spi.SessionSPI.
Definition at line 1215 of file SessionImpl.java.
|
inlineprotected |
Internally begin the transaction. Called by transactionState.begin().
Definition at line 733 of file SessionImpl.java.
|
inlineprotected |
Internally commit the transaction. Called by transactionState.commit().
Definition at line 761 of file SessionImpl.java.
|
inlineprotected |
Internally roll back the transaction. Called by transactionState.rollback() and transactionState.commit() if the transaction is marked for rollback.
Definition at line 796 of file SessionImpl.java.
|
inline |
Is this session closed?
Implements com.mysql.clusterj.Session.
Definition at line 709 of file SessionImpl.java.
|
inline |
Is the transaction enlisted. A transaction is enlisted if and only if an operation has been defined that requires an ndb transaction to be started.
Implements com.mysql.clusterj.core.spi.SessionSPI.
Definition at line 1081 of file SessionImpl.java.
|
inline |
Make a number of instances persistent.
instances | a Collection or array of objects to persist |
Definition at line 435 of file SessionImpl.java.
|
inline |
Mark an object as modified.
Implements com.mysql.clusterj.core.CacheManager.
Definition at line 1301 of file SessionImpl.java.
|
inline |
Mark the field in the instance as modified so it is flushed.
instance | the persistent instance |
fieldName | the field to mark as modified |
Implements com.mysql.clusterj.Session.
Definition at line 1331 of file SessionImpl.java.
|
inline |
Insert the instance into the database. This method has identical semantics to makePersistent.
instance | the instance to insert |
Implements com.mysql.clusterj.Session.
Definition at line 1293 of file SessionImpl.java.
|
inline |
Delete the instance from the database. This method has identical semantics to deletePersistent.
instance | the instance to delete |
Implements com.mysql.clusterj.Session.
Definition at line 1297 of file SessionImpl.java.
|
inline |
Roll back the current transaction.
Implements com.mysql.clusterj.core.spi.SessionSPI.
Definition at line 785 of file SessionImpl.java.
|
inline |
Save the instances even if they do not exist.
instances |
Definition at line 677 of file SessionImpl.java.
|
inline |
Select a single row from the database. Only the fields requested will be selected. A transaction must be active (either via begin or startAutoTransaction).
domainTypeHandler | the domainTypeHandler to be selected |
keyHandler | the key supplier for the select |
fields | the fields to select; null to select all fields |
Definition at line 583 of file SessionImpl.java.
|
inline |
Set the coordinatedTransactionId for the next transaction. This will take effect as soon as the transaction is enlisted.
coordinatedTransactionId | the coordinatedTransactionId |
Implements com.mysql.clusterj.core.spi.SessionSPI.
Definition at line 1375 of file SessionImpl.java.
|
inline |
Set the lock mode for subsequent operations. The lock mode takes effect immediately and continues until set again.
lockmode | the lock mode |
Implements com.mysql.clusterj.Session.
Definition at line 1383 of file SessionImpl.java.
|
inline |
Set the partition key for the next transaction. The key must be of the same type as the primary key defined by the table corresponding to the cls parameter. The key parameter is the wrapped version of the primitive type of the key, e.g. Integer for INT key types, Long for BIGINT key types, or String for char and varchar types.
For multi-column primary keys, the key parameter is an Object[], each element of which is a component of the primary key. The elements must be in the order of declaration of the columns (not necessarily the order defined in the CONSTRAINT ... PRIMARY KEY clause) of the CREATE TABLE statement.
ClusterJUserException | if a transaction is enlisted |
ClusterJUserException | if a partition key is null |
ClusterJUserException | if called twice in the same transaction |
ClusterJUserException | if a partition key is the wrong type |
key | the primary key of the mapped table |
Implements com.mysql.clusterj.Session.
Definition at line 1305 of file SessionImpl.java.
|
inline |
Mark the current transaction as rollback only.
Implements com.mysql.clusterj.core.spi.SessionSPI.
Definition at line 850 of file SessionImpl.java.
|
inline |
Start a transaction if there is not already an active transaction. Throw a ClusterJException if there is any problem.
Implements com.mysql.clusterj.core.spi.SessionSPI.
Definition at line 814 of file SessionImpl.java.
|
inline |
Update an instance in the database. The key field(s) are used to identify the instance; modified fields change the values in the database.
object | the instance to update in the database |
Implements com.mysql.clusterj.Session.
Definition at line 605 of file SessionImpl.java.
|
inline |
Update the instances corresponding to the parameters.
objects | the objects to update |
Definition at line 639 of file SessionImpl.java.
|
protected |
The list of objects changed since the last flush
Definition at line 109 of file SessionImpl.java.
|
protected |
The underlying ClusterTransaction
Definition at line 95 of file SessionImpl.java.
|
protected |
Db: one per session.
Definition at line 80 of file SessionImpl.java.
|
protected |
Dictionary: one per session.
Definition at line 83 of file SessionImpl.java.
|
protected |
My Factory.
Definition at line 77 of file SessionImpl.java.
|
protected |
The transaction id to join
Definition at line 98 of file SessionImpl.java.
|
protected |
Nested auto transaction counter.
Definition at line 123 of file SessionImpl.java.
|
protected |
Number of retries for retriable exceptions
Definition at line 127 of file SessionImpl.java.
|
protected |
The partition key
Definition at line 89 of file SessionImpl.java.
|
protected |
The list of pending operations, such as load operations, that need to be processed after the operation is sent to the database via
Definition at line 114 of file SessionImpl.java.
|
protected |
The properties for this session
Definition at line 101 of file SessionImpl.java.
|
protected |
Flags for iterating a scan
Definition at line 104 of file SessionImpl.java.
|
protected |
Rollback only status
Definition at line 92 of file SessionImpl.java.
|
protected |
One transaction at a time.
Definition at line 86 of file SessionImpl.java.
|
protected |
The transaction state of this session.
Definition at line 117 of file SessionImpl.java.
|
protected |
This represents the state of Transaction Active.
Definition at line 933 of file SessionImpl.java.
|
protected |
This represents the state of Transaction Not Active.
Definition at line 877 of file SessionImpl.java.