Skip to content

Commit

Permalink
Added lastTransactionCommitTimestampWhenStarted to interface
Browse files Browse the repository at this point in the history
  • Loading branch information
burqen committed Jul 1, 2016
1 parent dec2e48 commit 805197c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ interface CloseListener
*/
void markForTermination( Status reason );

/**
* @return The timestamp of the last transaction that was committed to the store when this transaction started.
*/
long lastTransactionTimestampWhenStarted();

/**
* Register a {@link CloseListener} to be invoked after commit, but before transaction events "after" hooks
* are invoked.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,7 @@ private boolean isTerminated()
return terminationReason != null;
}

@Override
public long lastTransactionTimestampWhenStarted()
{
return lastTransactionTimestampWhenStarted;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@ public void markForTermination( Status reason )
{
}

@Override
public long lastTransactionTimestampWhenStarted()
{
return 0;
}

@Override
public void registerCloseListener( CloseListener listener )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import org.neo4j.kernel.api.KernelTransaction;
import org.neo4j.kernel.api.exceptions.Status;
import org.neo4j.kernel.impl.api.BatchingTransactionRepresentationStoreApplier;
import org.neo4j.kernel.impl.api.KernelTransactionImplementation;
import org.neo4j.kernel.impl.api.KernelTransactions;
import org.neo4j.kernel.impl.api.TransactionRepresentationStoreApplier;
import org.neo4j.kernel.impl.api.index.IndexUpdatesValidator;
Expand Down Expand Up @@ -401,8 +400,7 @@ private void markUnsafeTransactionsForTermination()

for ( KernelTransaction tx : kernelTransactions.activeTransactions() )
{
KernelTransactionImplementation kti = (KernelTransactionImplementation) tx;
long commitTimestamp = kti.lastTransactionTimestampWhenStarted();
long commitTimestamp = tx.lastTransactionTimestampWhenStarted();

if ( commitTimestamp != TransactionIdStore.BASE_TX_COMMIT_TIMESTAMP &&
commitTimestamp < earliestSafeTimestamp )
Expand Down

0 comments on commit 805197c

Please sign in to comment.