Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrbrooks2009-12-31 18:13:36 +0000
committerrbrooks2009-12-31 18:13:36 +0000
commitb5a7ae5c6092b17fb1a0f53619a0f862f9124057 (patch)
tree064d310394ab71311e35df02038ede23015fc27d /org.eclipse.osee.framework.branch.management
parent13eedca1eb0c5119e85cc78f2bb5e4695402fa0a (diff)
downloadorg.eclipse.osee-b5a7ae5c6092b17fb1a0f53619a0f862f9124057.tar.gz
org.eclipse.osee-b5a7ae5c6092b17fb1a0f53619a0f862f9124057.tar.xz
org.eclipse.osee-b5a7ae5c6092b17fb1a0f53619a0f862f9124057.zip
handle bootstrapping of transaction for system root branch
Diffstat (limited to 'org.eclipse.osee.framework.branch.management')
-rw-r--r--org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/cache/DatabaseTransactionRecordAccessor.java20
1 files changed, 11 insertions, 9 deletions
diff --git a/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/cache/DatabaseTransactionRecordAccessor.java b/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/cache/DatabaseTransactionRecordAccessor.java
index 70d92092ba7..8898b5577e3 100644
--- a/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/cache/DatabaseTransactionRecordAccessor.java
+++ b/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/cache/DatabaseTransactionRecordAccessor.java
@@ -22,7 +22,6 @@ import org.eclipse.osee.framework.core.exception.OseeStateException;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.model.TransactionRecord;
import org.eclipse.osee.framework.core.model.TransactionRecordFactory;
-import org.eclipse.osee.framework.core.services.IOseeModelFactoryService;
import org.eclipse.osee.framework.core.services.IOseeModelFactoryServiceProvider;
import org.eclipse.osee.framework.database.IOseeDatabaseServiceProvider;
import org.eclipse.osee.framework.database.core.IOseeStatement;
@@ -55,10 +54,6 @@ public class DatabaseTransactionRecordAccessor implements ITransactionDataAccess
this.branchCache = branchCache;
}
- protected IOseeModelFactoryService getFactoryService() throws OseeCoreException {
- return factoryProvider.getOseeFactoryService();
- }
-
private synchronized void ensureDependantCachePopulated() throws OseeCoreException {
branchCache.ensurePopulated();
}
@@ -119,7 +114,6 @@ public class DatabaseTransactionRecordAccessor implements ITransactionDataAccess
private TransactionRecord loadFromTransaction(TransactionCache cache, Branch branch, int fetchSize, boolean isOnlyReadFirstResult, String query, Object... parameters) throws OseeCoreException {
IOseeStatement chStmt = oseeDatabaseProvider.getOseeDatabaseService().getStatement();
- TransactionRecordFactory factory = getFactoryService().getTransactionFactory();
TransactionRecord record = null;
try {
chStmt.runPreparedQuery(fetchSize, query, parameters);
@@ -133,10 +127,8 @@ public class DatabaseTransactionRecordAccessor implements ITransactionDataAccess
TransactionDetailsType txType = TransactionDetailsType.toEnum(chStmt.getInt("tx_type"));
record =
- factory.createOrUpdate(cache, transactionNumber, branchId, comment, timestamp, authorArtId,
+ prepareTransactionRecord(cache, transactionNumber, branchId, comment, timestamp, authorArtId,
commitArtId, txType);
- record.setBranchCache(branchCache);
- record.clearDirty();
if (isOnlyReadFirstResult) {
break;
}
@@ -147,6 +139,16 @@ public class DatabaseTransactionRecordAccessor implements ITransactionDataAccess
return record;
}
+ private TransactionRecord prepareTransactionRecord(TransactionCache cache, int transactionNumber, int branchId, String comment, Date timestamp, int authorArtId, int commitArtId, TransactionDetailsType txType) throws OseeCoreException {
+ TransactionRecordFactory factory = factoryProvider.getOseeFactoryService().getTransactionFactory();
+ TransactionRecord record =
+ factory.createOrUpdate(cache, transactionNumber, branchId, comment, timestamp, authorArtId, commitArtId,
+ txType);
+ record.setBranchCache(branchCache);
+ record.clearDirty();
+ return record;
+ }
+
@Override
public void load(TransactionCache transactionCache) throws OseeCoreException {
}

Back to the top