From c640462b91116f12b7a364f9559cd32fbcb7d07b Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Thu, 19 Oct 2006 22:19:30 +0000 Subject: Use pipe separator for top level transaction. --- .../com/amazon/carbonado/repo/logging/LoggingRepository.java | 6 +++--- .../com/amazon/carbonado/repo/logging/LoggingTransaction.java | 10 ++++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/amazon/carbonado/repo/logging/LoggingRepository.java b/src/main/java/com/amazon/carbonado/repo/logging/LoggingRepository.java index 58639e2..611df4f 100644 --- a/src/main/java/com/amazon/carbonado/repo/logging/LoggingRepository.java +++ b/src/main/java/com/amazon/carbonado/repo/logging/LoggingRepository.java @@ -76,21 +76,21 @@ class LoggingRepository implements Repository, LogAccessCapability { public Transaction enterTransaction() { mLog.write("Repository.enterTransaction()"); - return new LoggingTransaction(mLog, mRepo.enterTransaction()); + return new LoggingTransaction(mLog, mRepo.enterTransaction(), false); } public Transaction enterTransaction(IsolationLevel level) { if (mLog.isEnabled()) { mLog.write("Repository.enterTransaction(" + level + ')'); } - return new LoggingTransaction(mLog, mRepo.enterTransaction(level)); + return new LoggingTransaction(mLog, mRepo.enterTransaction(level), false); } public Transaction enterTopTransaction(IsolationLevel level) { if (mLog.isEnabled()) { mLog.write("Repository.enterTopTransaction(" + level + ')'); } - return new LoggingTransaction(mLog, mRepo.enterTopTransaction(level)); + return new LoggingTransaction(mLog, mRepo.enterTopTransaction(level), true); } public IsolationLevel getTransactionIsolationLevel() { diff --git a/src/main/java/com/amazon/carbonado/repo/logging/LoggingTransaction.java b/src/main/java/com/amazon/carbonado/repo/logging/LoggingTransaction.java index b9782c8..2fe9865 100644 --- a/src/main/java/com/amazon/carbonado/repo/logging/LoggingTransaction.java +++ b/src/main/java/com/amazon/carbonado/repo/logging/LoggingTransaction.java @@ -40,12 +40,14 @@ class LoggingTransaction implements Transaction { private final Log mLog; private final Transaction mTxn; private final long mID; + private final boolean mTop; - LoggingTransaction(Log log, Transaction txn) { + LoggingTransaction(Log log, Transaction txn, boolean top) { mParent = mActiveTxn.get(); mLog = log; mTxn = txn; mID = mNextID.addAndGet(1); + mTop = top; mActiveTxn.set(this); mLog.write("Entered transaction: " + idChain()); } @@ -84,6 +86,10 @@ class LoggingTransaction implements Transaction { if (mParent == null) { return String.valueOf(mID); } - return mParent.idChain() + " > " + mID; + if (mTop) { + return mParent.idChain() + " | " + mID; + } else { + return mParent.idChain() + " > " + mID; + } } } -- cgit v1.2.3