[
https://issues.apache.org/jira/browse/CXF-3114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12935261#action_12935261
]
Freeman Fang commented on CXF-3114:
-----------------------------------
apply patch on behalf of Aki Yoshida with thanks
http://svn.apache.org/viewvc?rev=1038509&view=rev for trunk
http://svn.apache.org/viewvc?rev=1038519&view=rev for 2.3 branch
http://svn.apache.org/viewvc?rev=1038524&view=rev for 2.2 branch
> WS-RM's RMTxStore's does not recover stored sequences after restart
> -------------------------------------------------------------------
>
> Key: CXF-3114
> URL: https://issues.apache.org/jira/browse/CXF-3114
> Project: CXF
> Issue Type: Bug
> Environment: CXF 2.2.11 with Derby 10.6.2.1
> Reporter: Aki Yoshida
> Assignee: Freeman Fang
> Fix For: 2.2.12, 2.3.1, 2.4
>
> Attachments: rt-ws-fixes.zip
>
>
> When WS-RM's derby storage is activated, the sequence data are persisted in
> the database.
> However, these sequence data are not loaded from the database when the WS-RM
> component is restarted.
> This problem appears to be caused by the init method of the persistence class
> org.apache.cxf.ws.rm.persistence.jdbc.RMTxStore which leaves an uncommitted
> transaction to the relevant tables open. Consequently, the next select
> statement that loads the persisted sequence data is not seeing the content.
> The original source code fragment of this method looks like this:
> {code}
> try {
> connection.setAutoCommit(false);
> createTables();
> } catch (SQLException ex) {
> LogUtils.log(LOG, Level.SEVERE, "CONNECT_EXC", ex);
> SQLException se = ex;
> while (se.getNextException() != null) {
> se = se.getNextException();
> LogUtils.log(LOG, Level.SEVERE, "CONNECT_EXC", se);
> }
> throw new RMStoreException(ex);
> }
> {code}
> The suggested change would be as follows:
> {code}
> try {
> connection.setAutoCommit(true);
> createTables();
> } catch (SQLException ex) {
> LogUtils.log(LOG, Level.SEVERE, "CONNECT_EXC", ex);
> SQLException se = ex;
> while (se.getNextException() != null) {
> se = se.getNextException();
> LogUtils.log(LOG, Level.SEVERE, "CONNECT_EXC", se);
> }
> throw new RMStoreException(ex);
> } finally {
> try {
> connection.setAutoCommit(false);
> } catch (SQLException ex) {
> LogUtils.log(LOG, Level.SEVERE, "CONNECT_EXC", ex);
> throw new RMStoreException(ex);
> }
> }
> {code}
> In the above code, the setAutoCommit(true) statement could be omitted if we
> simply want to rely on the default autoCommit mode.
> In any case, the suggested code makes sure that the subsequence statement is
> correctly executed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.