Skip to content

Commit

Permalink
Renamed TransactionalContext.provideContext to getOrBeginNewIfClosed
Browse files Browse the repository at this point in the history
  • Loading branch information
fickludd committed Sep 16, 2016
1 parent f70712e commit 22acac6
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
Expand Up @@ -147,7 +147,7 @@ class ExecutionEngine(val queryService: GraphDatabaseQueryService, logProvider:
var n = 0
while (n < ExecutionEngine.PLAN_BUILDING_TRIES) {
// create transaction and query context
val tc = externalTransactionalContext.provideContext()
val tc = externalTransactionalContext.getOrBeginNewIfClosed()

// Temporarily change access mode during query planning
// NOTE: The OVERRIDE_READ mode will force read access even if the current transaction did not have it
Expand Down
Expand Up @@ -35,7 +35,7 @@ case class TransactionalContextWrapperv3_0(tc: TransactionalContext) extends Que

override type DbmsOps = DbmsOperations

def provideContext(): TransactionalContextWrapperv3_0 = TransactionalContextWrapperv3_0(tc.provideContext())
def getOrBeginNewIfClosed(): TransactionalContextWrapperv3_0 = TransactionalContextWrapperv3_0(tc.getOrBeginNewIfClosed())

def isOpen: Boolean = tc.isOpen

Expand Down
Expand Up @@ -35,7 +35,7 @@ case class TransactionalContextWrapperv3_1(tc: TransactionalContext) extends Que

override type DbmsOps = DbmsOperations

def provideContext(): TransactionalContextWrapperv3_1 = TransactionalContextWrapperv3_1(tc.provideContext())
def getOrBeginNewIfClosed(): TransactionalContextWrapperv3_1 = TransactionalContextWrapperv3_1(tc.getOrBeginNewIfClosed())

def isOpen: Boolean = tc.isOpen

Expand Down
Expand Up @@ -74,7 +74,7 @@ final class TransactionBoundQueryContext(tc: TransactionalContextWrapperv3_1)
if (tc.isOpen) {
work(this)
} else {
val context = tc.provideContext()
val context = tc.getOrBeginNewIfClosed()
var success = false
try {
val result = work(new TransactionBoundQueryContext(context))
Expand Down
Expand Up @@ -76,7 +76,7 @@ final class TransactionBoundQueryContext(val transactionalContext: Transactional
if (transactionalContext.isOpen) {
work(this)
} else {
val context = transactionalContext.provideContext()
val context = transactionalContext.getOrBeginNewIfClosed()
var success = false
try {
val result = work(new TransactionBoundQueryContext(context))
Expand Down
Expand Up @@ -77,7 +77,7 @@ final class TransactionBoundQueryContext(val transactionalContext: Transactional
if (transactionalContext.isOpen) {
work(this)
} else {
val context = transactionalContext.provideContext()
val context = transactionalContext.getOrBeginNewIfClosed()
var success = false
try {
val result = work(new TransactionBoundQueryContext(context))
Expand Down
Expand Up @@ -194,7 +194,7 @@ public void cleanForReuse()
}

@Override
public TransactionalContext provideContext()
public TransactionalContext getOrBeginNewIfClosed()
{
if ( isOpen )
{
Expand Down
Expand Up @@ -46,7 +46,7 @@ public interface TransactionalContext

void cleanForReuse();

TransactionalContext provideContext();
TransactionalContext getOrBeginNewIfClosed();

boolean isOpen();

Expand Down
Expand Up @@ -81,7 +81,7 @@ public void cleanForReuse()
}

@Override
public TransactionalContext provideContext()
public TransactionalContext getOrBeginNewIfClosed()
{
throw new UnsupportedOperationException( "fake test class" );
}
Expand Down

0 comments on commit 22acac6

Please sign in to comment.