Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r87 - trunk/src/main/java/org/tigris/limax/Transaction.java

limax
Discussion topic

Back to topic list

svn commit: r87 - trunk/src/main/java/org/tigris/limax/Transaction.java

Reply

Author wettin
Full name Karl Wettin
Date 2007-09-30 13:57:33 PDT
Message Author: wettin
Date: 2007-09-30 13:57:33-0700
New Revision: 87

Modified:
   trunk/src/main/java/​org/tigris/limax/Tra​nsaction.java

Log:
auto commit fixes

Modified: trunk/src/main/java/​org/tigris/limax/Tra​nsaction.java
Url: http://limax.tigris.​org/source/browse/li​max/trunk/src/main/j​ava/org/tigris/limax​/Transaction.java?vi​ew=diff&rev=87​&p1=trunk/src/main​/java/org/tigris/lim​ax/Transaction.java​&p2=trunk/src/mai​n/java/org/tigris/li​max/Transaction.java​&r1=86&r2=87​
====================​====================​====================​==================
--- trunk/src/main/java/​org/tigris/limax/Tra​nsaction.java (original)
+++ trunk/src/main/java/​org/tigris/limax/Tra​nsaction.java 2007-09-30 13:57:33-0700
@@ -62,6 +62,7 @@
   private boolean autoCommit = true;
   private int autoCommitSize = 50000;
   private int changesUntilAutoCommit = autoCommitSize;
+ private boolean clearEntitiesOnAutoCommit = false;
 
   private void notifyAutoCommit() throws IOException {
     int changes = changesUntilAutoCommit--;
@@ -74,9 +75,28 @@
       commit();
       changesUntilAutoCommit = autoCommitSize;
       reuse();
+ if (isClearEntitiesOnAutoCommit()) {
+ entitiesByOID.clear();
+ }
     }
   }
 
+ public boolean isClearEntitiesOnAutoCommit() {
+ return clearEntitiesOnAutoCommit;
+ }
+
+ public void setClearEntitiesOnAu​toCommit(boolean clearEntitiesOnAutoCommit) {
+ this.clearEntitiesOnAutoCommit = clearEntitiesOnAutoCommit;
+ }
+
+ public int getAutoCommitSize() {
+ return autoCommitSize;
+ }
+
+ public void setAutoCommitSize(int autoCommitSize) {
+ this.autoCommitSize = autoCommitSize;
+ }
+
   public void create(Class entityClass, Long oid, Object entity) throws IOException {
     Delta delta = getPendingDelta(entityClass);
     delta.getCreated().put(oid, entity);
@@ -867,8 +887,8 @@
           }
         }
       }
- systemIndexWriter.ad​dIndexes(new IndexReader[]{transa​ctionIndexReader});
       transactionIndexReader.close();
+ systemIndexWriter.ad​dIndexesNoOptimize(n​ew Directory[]{transactionIndex});
       transactionIndex.close();
       transactionIndex = null;
     }

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r87 - trunk/src/main/java/org/tigris/limax/Transaction.java wettin Karl Wettin 2007-09-30 13:57:33 PDT
Messages per page: