Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorddunne2010-01-02 15:57:39 +0000
committerddunne2010-01-02 15:57:39 +0000
commit8542316e04b1dfc57c2582e423ea76134f22c614 (patch)
treef5f699a793af07de88c37fbcc1a723880ef46b85
parent3749b4e13053b12fc19ceebd0590f17dce0df092 (diff)
downloadorg.eclipse.osee-8542316e04b1dfc57c2582e423ea76134f22c614.tar.gz
org.eclipse.osee-8542316e04b1dfc57c2582e423ea76134f22c614.tar.xz
org.eclipse.osee-8542316e04b1dfc57c2582e423ea76134f22c614.zip
add comment to transaction exception
-rw-r--r--org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/SkynetTransaction.java13
-rw-r--r--org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionMonitor.java12
2 files changed, 7 insertions, 18 deletions
diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/SkynetTransaction.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/SkynetTransaction.java
index d4d0ede1c90..c51ffbcbbc6 100644
--- a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/SkynetTransaction.java
+++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/SkynetTransaction.java
@@ -80,7 +80,7 @@ public class SkynetTransaction extends DbTransaction {
public SkynetTransaction(Branch branch, String comment) {
this.branch = branch;
this.comment = comment;
- txMonitor.reportTxCreation(this, branch);
+ txMonitor.reportTxCreation(this, branch, comment);
}
public SkynetTransaction(IOseeBranch branch, String comment) throws OseeCoreException {
@@ -99,9 +99,6 @@ public class SkynetTransaction extends DbTransaction {
transactionId = null;
}
- /**
- * @return the branch
- */
public Branch getBranch() {
return branch;
}
@@ -214,18 +211,10 @@ public class SkynetTransaction extends DbTransaction {
}
}
- /**
- * @return the transaction number.
- * @throws OseeDataStoreException
- */
public int getTransactionNumber() throws OseeCoreException {
return internalGetTransactionId().getId();
}
- /**
- * @return Returns the transactionId.
- * @throws OseeDataStoreException
- */
TransactionRecord internalGetTransactionId() throws OseeCoreException {
if (transactionId == null) {
transactionId = TransactionManager.createNextTransactionId(branch, UserManager.getUser(), comment);
diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionMonitor.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionMonitor.java
index b29ef3de0fd..13b46848249 100644
--- a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionMonitor.java
+++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionMonitor.java
@@ -24,10 +24,9 @@ import org.eclipse.osee.framework.skynet.core.internal.Activator;
*/
public class TransactionMonitor {
+ private String lastComment;
private enum TxState {
- CREATED,
- RUNNING,
- ENDED;
+ CREATED, RUNNING, ENDED;
}
private final Map<Object, TxOperation> txMap;
@@ -36,16 +35,17 @@ public class TransactionMonitor {
this.txMap = new WeakHashMap<Object, TxOperation>();
}
- public synchronized void reportTxCreation(final DbTransaction transaction, Object key) {
+ public synchronized void reportTxCreation(final DbTransaction transaction, Object key, String comment) {
TxOperation currentTx = txMap.get(key);
if (currentTx != null) {
// This log is to support debugging the case where osee transactions are nested and should
// use the same transaction.
// This case may happens legitimately if an exception occurs outside this API before transaction.execute() is called,
// so it is only notification that this is occurring.
- OseeLog.log(Activator.class, Level.SEVERE, "New transaction created over Last transaction",
- currentTx.getError());
+ OseeLog.log(Activator.class, Level.SEVERE, String.format(
+ "New transaction [%s] created over Last transaction [%s]", comment, lastComment), currentTx.getError());
}
+ lastComment = comment;
txMap.put(key, new TxOperation(transaction));
}

Back to the top