Author: jaz
Date: Sun May 20 22:00:58 2007
New Revision: 540027
URL:
http://svn.apache.org/viewvc?view=rev&rev=540027Log:
added transaction to index keywords (7200)
Modified:
ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java?view=diff&rev=540027&r1=540026&r2=540027==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java Sun May 20 22:00:58 2007
@@ -309,7 +309,10 @@
int numProds = 0;
int errProds = 0;
+ boolean beganTx = false;
try {
+ // begin the transaction
+ beganTx = TransactionUtil.begin(7200);
try {
if (Debug.infoOn()) {
long count = delegator.findCountByCondition("Product", condition, null);
@@ -340,10 +343,20 @@
}
}
} catch (GenericEntityException e) {
+ try {
+ TransactionUtil.rollback(beganTx, e.getMessage(), e);
+ } catch (Exception e1) {
+ Debug.logError(e1, module);
+ }
return "error";
} catch (Throwable t) {
Debug.logError(t, module);
request.setAttribute("_ERROR_MESSAGE_", t.getMessage());
+ try {
+ TransactionUtil.rollback(beganTx, t.getMessage(), t);
+ } catch (Exception e2) {
+ Debug.logError(e2, module);
+ }
return "error";
} finally {
if (entityListIterator != null) {
@@ -352,6 +365,13 @@
} catch (GenericEntityException gee) {
Debug.logError(gee, "Error closing EntityListIterator when indexing product keywords.", module);
}
+ }
+
+ // commit the transaction
+ try {
+ TransactionUtil.commit(beganTx);
+ } catch (Exception e) {
+ Debug.logError(e, module);
}
}