diff options
author | Brian S. O'Neill <bronee@gmail.com> | 2006-10-19 22:19:30 +0000 |
---|---|---|
committer | Brian S. O'Neill <bronee@gmail.com> | 2006-10-19 22:19:30 +0000 |
commit | c640462b91116f12b7a364f9559cd32fbcb7d07b (patch) | |
tree | beb90760e58f9a79ff4e6fcbedf8964dfb18054f /src/main/java/com/amazon/carbonado/repo | |
parent | 30cc7f1c3943be87573849864f1f0637fd5cc3c6 (diff) |
Use pipe separator for top level transaction.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/repo')
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/logging/LoggingRepository.java | 6 | ||||
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/logging/LoggingTransaction.java | 10 |
2 files changed, 11 insertions, 5 deletions
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;
+ }
}
}
|