You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ay...@apache.org on 2012/06/14 09:44:50 UTC
svn commit: r1350114 - in /cxf/trunk/rt/ws/rm/src/main:
java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java
resources/schemas/configuration/wsrm-manager.xsd
Author: ay
Date: Thu Jun 14 07:44:49 2012
New Revision: 1350114
URL: http://svn.apache.org/viewvc?rev=1350114&view=rev
Log:
add reconnect attributes in rmstore schema (CXF-4362) et al
Modified:
cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java
cxf/trunk/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager.xsd
Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java?rev=1350114&r1=1350113&r2=1350114&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java Thu Jun 14 07:44:49 2012
@@ -107,10 +107,13 @@ public class RMTxStore implements RMStor
MESSAGES_TABLE_COLS, MESSAGES_TABLE_KEYS);
private static final String CREATE_DEST_SEQUENCE_STMT_STR
- = "INSERT INTO CXF_RM_DEST_SEQUENCES (SEQ_ID, ACKS_TO, ENDPOINT_ID, PROTOCOL_VERSION) "
+ = "INSERT INTO CXF_RM_DEST_SEQUENCES "
+ + "(SEQ_ID, ACKS_TO, ENDPOINT_ID, PROTOCOL_VERSION) "
+ "VALUES(?, ?, ?, ?)";
private static final String CREATE_SRC_SEQUENCE_STMT_STR
- = "INSERT INTO CXF_RM_SRC_SEQUENCES VALUES(?, 1, '0', ?, ?, ?, ?)";
+ = "INSERT INTO CXF_RM_SRC_SEQUENCES "
+ + "(SEQ_ID, CUR_MSG_NO, LAST_MSG, EXPIRY, OFFERING_SEQ_ID, ENDPOINT_ID, PROTOCOL_VERSION) "
+ + "VALUES(?, 1, '0', ?, ?, ?, ?)";
private static final String DELETE_DEST_SEQUENCE_STMT_STR =
"DELETE FROM CXF_RM_DEST_SEQUENCES WHERE SEQ_ID = ?";
private static final String DELETE_SRC_SEQUENCE_STMT_STR =
@@ -120,7 +123,7 @@ public class RMTxStore implements RMStor
private static final String UPDATE_SRC_SEQUENCE_STMT_STR =
"UPDATE CXF_RM_SRC_SEQUENCES SET CUR_MSG_NO = ?, LAST_MSG = ? WHERE SEQ_ID = ?";
private static final String CREATE_MESSAGE_STMT_STR
- = "INSERT INTO {0} VALUES(?, ?, ?, ?)";
+ = "INSERT INTO {0} (SEQ_ID, MSG_NO, SEND_TO, CONTENT) VALUES(?, ?, ?, ?)";
private static final String DELETE_MESSAGE_STMT_STR =
"DELETE FROM {0} WHERE SEQ_ID = ? AND MSG_NO = ?";
private static final String SELECT_DEST_SEQUENCE_STMT_STR =
@@ -984,7 +987,7 @@ public class RMTxStore implements RMStor
return connection;
}
- private void verifyConnection() {
+ protected synchronized void verifyConnection() {
if (createdConnection && nextReconnectAttempt > 0
&& (maxReconnectAttempts < 0 || maxReconnectAttempts > reconnectAttempts)) {
if (System.currentTimeMillis() > nextReconnectAttempt) {
@@ -1001,7 +1004,7 @@ public class RMTxStore implements RMStor
}
}
- private synchronized void updateConnectionState(SQLException e) {
+ protected synchronized void updateConnectionState(SQLException e) {
if (e == null) {
// reset the previous error status
reconnectDelay = 0;
Modified: cxf/trunk/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager.xsd
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager.xsd?rev=1350114&r1=1350113&r2=1350114&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager.xsd (original)
+++ cxf/trunk/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager.xsd Thu Jun 14 07:44:49 2012
@@ -192,6 +192,22 @@
</xs:documentation>
</xs:annotation>
</xs:attribute>
+ <xs:attribute name="initialReconnectDelay" type="xs:long" default="60000">
+ <xs:annotation>
+ <xs:documentation>
+ The initialy delay before attempting to reconnect to the database. The subsequent
+ delay follows the exponential backoff algorithm.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="maxReconnectAttempts" type="xs:int" default="10">
+ <xs:annotation>
+ <xs:documentation>
+ The maximum number of attemps taken to reconnect to the database after a connection error.
+ The value of 0 indicates no attempt, while a negative value indicates no limit.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>