From: <ssk...@vh...> - 2005-09-14 09:17:36
|
Author: sskracic Date: 2005-09-14 11:08:15 +0200 (Wed, 14 Sep 2005) New Revision: 804 Modified: ccm-cms/trunk/src/com/arsdigita/cms/publishToFile/QueueManager.java Log: P2fs should be able to survive database restarts. The problem was in tnx.abortTnx() which was outside try/catch block so it was causing the p2fs thread to die whenever a database connection was temporarily lost. Modified: ccm-cms/trunk/src/com/arsdigita/cms/publishToFile/QueueManager.java =================================================================== --- ccm-cms/trunk/src/com/arsdigita/cms/publishToFile/QueueManager.java 2005-09-13 14:45:49 UTC (rev 803) +++ ccm-cms/trunk/src/com/arsdigita/cms/publishToFile/QueueManager.java 2005-09-14 09:08:15 UTC (rev 804) @@ -509,15 +509,20 @@ } catch (Exception e) { s_log.warn("Ignoring uncaught exception", e); } finally { - if ( query != null ) { - query.close(); + try { + if ( query != null ) { + query.close(); + } + + if ( txn.inTxn() ) { + txn.abortTxn(); + s_log.info("Aborting transaction"); + } + } catch (Exception e) { + s_log.warn("Txn cleanup failed", e); + } finally { query = null; } - - if ( txn.inTxn() ) { - txn.abortTxn(); - s_log.info("Aborting transaction"); - } } // Tell the caller if there are more items to process. |