Package org.umlg.sqlg.structure
Class SqlgTransaction
java.lang.Object
org.apache.tinkerpop.gremlin.structure.util.AbstractTransaction
org.apache.tinkerpop.gremlin.structure.util.AbstractThreadLocalTransaction
org.umlg.sqlg.structure.SqlgTransaction
- All Implemented Interfaces:
AutoCloseable
,org.apache.tinkerpop.gremlin.structure.Transaction
public class SqlgTransaction
extends org.apache.tinkerpop.gremlin.structure.util.AbstractThreadLocalTransaction
This class is a singleton. Instantiated and owned by SqlGraph.
It manages the opening, commit, rollback and close of the java.sql.Connection in a threadvar.
Date: 2014/07/12
Time: 2:18 PM
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.structure.Transaction
org.apache.tinkerpop.gremlin.structure.Transaction.CLOSE_BEHAVIOR, org.apache.tinkerpop.gremlin.structure.Transaction.Exceptions, org.apache.tinkerpop.gremlin.structure.Transaction.READ_WRITE_BEHAVIOR, org.apache.tinkerpop.gremlin.structure.Transaction.Status, org.apache.tinkerpop.gremlin.structure.Transaction.Symbols
-
Field Summary
Fields inherited from class org.apache.tinkerpop.gremlin.structure.util.AbstractThreadLocalTransaction
closeConsumerInternal, readWriteConsumerInternal, transactionListeners
Fields inherited from interface org.apache.tinkerpop.gremlin.structure.Transaction
NO_OP
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(PreparedStatement preparedStatement) void
afterCommit
(AfterCommit afterCommitFunction) void
afterRollback
(AfterRollback afterCommitFunction) void
batchMode
(BatchManager.BatchModeType batchModeType) void
beforeCommit
(BeforeCommit beforeCommitFunction) void
checkMultiplicity
(org.apache.tinkerpop.gremlin.structure.Vertex vertex, org.apache.tinkerpop.gremlin.structure.Direction direction, EdgeLabel edgeLabel, VertexLabel otherSide) void
checkMultiplicity
(VertexLabel vertexLabel, org.apache.tinkerpop.gremlin.structure.Direction direction, EdgeLabel edgeLabel, VertexLabel otherSide) Utilizes LEFT JOIN but COUNT on the far side.protected void
doCommit()
protected void
doOpen()
protected void
void
flush()
get fetch size for current transactionboolean
boolean
boolean
boolean
boolean
are we reading the SQL query results lazily?boolean
isOpen()
boolean
boolean
void
void
setDefaultFetchSize
(Integer fetchSize) set default fetch sizevoid
setFetchSize
(Integer fetchSize) set fetch size for current transactionvoid
setLazyQueries
(boolean lazy) set the laziness on query result readingvoid
setWriteTransaction
(boolean b) void
void
void
IfTopology.isLocked()
then this method will unlock theTopology
for the duration of the transaction.Methods inherited from class org.apache.tinkerpop.gremlin.structure.util.AbstractThreadLocalTransaction
addTransactionListener, clearTransactionListeners, doClose, doReadWrite, fireOnCommit, fireOnRollback, onClose, onReadWrite, removeTransactionListener
Methods inherited from class org.apache.tinkerpop.gremlin.structure.util.AbstractTransaction
begin, close, commit, createThreadedTx, open, readWrite, rollback
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.tinkerpop.gremlin.structure.Transaction
begin
-
Field Details
-
QUERY_LAZY
- See Also:
-
-
Method Details
-
doOpen
protected void doOpen()- Specified by:
doOpen
in classorg.apache.tinkerpop.gremlin.structure.util.AbstractTransaction
-
doCommit
protected void doCommit() throws org.apache.tinkerpop.gremlin.structure.util.TransactionException- Specified by:
doCommit
in classorg.apache.tinkerpop.gremlin.structure.util.AbstractTransaction
- Throws:
org.apache.tinkerpop.gremlin.structure.util.TransactionException
-
doRollback
protected void doRollback() throws org.apache.tinkerpop.gremlin.structure.util.TransactionException- Specified by:
doRollback
in classorg.apache.tinkerpop.gremlin.structure.util.AbstractTransaction
- Throws:
org.apache.tinkerpop.gremlin.structure.util.TransactionException
-
unlockTopology
public void unlockTopology()IfTopology.isLocked()
then this method will unlock theTopology
for the duration of the transaction. It will automatically be locked again on commit or rollback. -
isTopologyLocked
public boolean isTopologyLocked()- Returns:
- Returns false if the topology is unlocked or the current transaction has not unlocked it.
-
streamingWithLockBatchModeOn
public void streamingWithLockBatchModeOn() -
streamingBatchModeOn
public void streamingBatchModeOn() -
batchMode
-
normalBatchModeOn
public void normalBatchModeOn() -
isInBatchMode
public boolean isInBatchMode() -
isInNormalBatchMode
public boolean isInNormalBatchMode() -
isInStreamingBatchMode
public boolean isInStreamingBatchMode() -
isInStreamingWithLockBatchMode
public boolean isInStreamingWithLockBatchMode() -
getBatchModeType
-
getBatchManager
-
getConnection
-
flush
public void flush() -
beforeCommit
-
afterCommit
-
afterRollback
-
isOpen
public boolean isOpen() -
add
-
getPreparedStatementCache
-
isLazyQueries
public boolean isLazyQueries()are we reading the SQL query results lazily?- Returns:
- true if we are processing the results lazily, false otherwise
-
setLazyQueries
public void setLazyQueries(boolean lazy) set the laziness on query result reading- Parameters:
lazy
- boolean to set the query as lazy or not.
-
setDefaultFetchSize
set default fetch size- Parameters:
fetchSize
- Set the jdbc fetch size
-
getFetchSize
get fetch size for current transaction- Returns:
- The jdbc fetch for the current transaction
-
setFetchSize
set fetch size for current transaction- Parameters:
fetchSize
- Set the current transaction's jdbc fetch size
-
isWriteTransaction
public boolean isWriteTransaction() -
setWriteTransaction
public void setWriteTransaction(boolean b) -
checkMultiplicity
public void checkMultiplicity(org.apache.tinkerpop.gremlin.structure.Vertex vertex, org.apache.tinkerpop.gremlin.structure.Direction direction, EdgeLabel edgeLabel, VertexLabel otherSide) -
checkMultiplicity
public void checkMultiplicity(VertexLabel vertexLabel, org.apache.tinkerpop.gremlin.structure.Direction direction, EdgeLabel edgeLabel, VertexLabel otherSide) Utilizes LEFT JOIN but COUNT on the far side.
-