Here is a patch for the J2EEContentStore (although also relates to
JDBC).
Two changes:
1) The SQL used to check if an object is already stored in the slide
store currently returns the whole content of a row only to check if the
resultset is empty of not and immediately close it. This may result in
the return of the contents of a blob column for no real reason. The
patch replaces the SELECT * with a SELECT 1 which will have the same
effect (i.e. create a resultset row) but without the overhead.
2) The Contentstore looks for the the revision content via the
storeRevisionContent method and when nothing is found calls the
createRevisionContent method.
But what happens is the storeRevisionContent method on the absence of
revisioncontent throws a RevisionAlreadyExistException exception, the
exception is caught and thrown again. The impelementation in the
abstractStore catches the exception and delists the transaction.
This lead to the HeuristicRollback further down the line in the
transaction commit in the Slidetransaction program
The throw e is removed and replaced with a log entry to stop premature
termination of the transaction, as an attempt is later made to use it
again.
rgds
CB
Index: J2EEContentStore.java
===================================================================
RCS file:
/home/cvspublic/jakarta-slide/src/stores/slidestore/j2ee/J2EEContentStore.java,v
retrieving revision 1.2
diff -u -r1.2 J2EEContentStore.java
--- J2EEContentStore.java 2 Jan 2002 21:18:48 -0000 1.2
+++ J2EEContentStore.java 2 Jan 2002 21:49:19 -0000
@@ -463,7 +463,7 @@
try {
selectStatement = connection.prepareStatement
- ("select * from revisioncontent where uri = ? and "
+ ("select 1 from revisioncontent where uri = ? and "
+ "xnumber = ?");
selectStatement.setString(1, revisionUri);
selectStatement.setString(2, revisionNumber);
@@ -487,7 +487,8 @@
getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
throw new ServiceAccessException(this, e.getMessage());
} catch(RevisionAlreadyExistException e) {
- throw e; // we do NOT want this caught by next clause.
+ //throw e; // we do NOT want this caught by next clause.
+ getLogger().log("RevisionAlreadyExistException encountered for "+
+revisionUri,LOG_CHANNEL,Logger.WARNING);
} catch (Exception e) {
getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
throw new ServiceAccessException(this, e.getMessage());
@@ -518,7 +519,7 @@
try {
selectStatement = connection.prepareStatement
- ("select * from revisioncontent where uri = ? and "
+ ("select 1 from revisioncontent where uri = ? and "
+ "xnumber = ?");
selectStatement.setString(1, revisionUri);
selectStatement.setString(2, revisionNumber);
@@ -544,7 +545,8 @@
getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
throw new ServiceAccessException(this, e.getMessage());
} catch(RevisionNotFoundException e) {
- throw e; // we do NOT want this caught by next clause.
+ //throw e; // we do NOT want this caught by next clause.
+ getLogger().log("RevisionNotFoundException encountered for "+
+revisionUri,LOG_CHANNEL,Logger.WARNING);
} catch (Exception e) {
getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
throw new ServiceAccessException(this, e.getMessage());
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>