[ 
https://issues.apache.org/jira/browse/CXF-3853?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13136075#comment-13136075
 ] 

Aki Yoshida commented on CXF-3853:
----------------------------------

Initially, I was thinking of introducing some properties in the store 
configuration. But this will require a change in the configuration schema and 
hence will require more thought to find the best solution. 

Therefore, for now, I think we should provide a simpler less-invasive approach, 
namely changing the isTableExistsError method of RMTxStore to a protected 
instance method so that you can write your own RMTxStore to overwrite this 
method.

This means, you can write your store as:

{code}
package demo.cxf.ws.rm.persistence.jdbc;

import java.sql.SQLException;

import org.apache.cxf.ws.rm.persistence.jdbc.RMTxStore;


public class MyCustomRMStore extends RMTxStore {
    private static final String MYDB_TABLE_EXISTS_STATE = "I6000";

    @Override
    protected boolean isTableExistsError(SQLException ex) {
        return MYDB_TABLE_EXISTS_STATE.equals(ex.getSQLState());
    }

}
{code}

and you can instantiate this bean and set to it the rm-manager's store.
{code}
<bean id="testStore" class="demo.cxf.ws.rm.persistence.jdbc.MyCustomRMStore">
    <property name="driverClassName" value="..."/>
    <property name="userName" value="..."/>
    <property name="password" value="..."/>
    <property name="url" value="jdbc:..."/>
</bean>
{code} 

                
> RMTxStore: Vendor specific condition check
> ------------------------------------------
>
>                 Key: CXF-3853
>                 URL: https://issues.apache.org/jira/browse/CXF-3853
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime
>            Reporter: Harsha Hegde
>            Assignee: Aki Yoshida
>
> While using the reliable messaging in the CXF. The condition checks to create 
> Database tables for a given RM store is vendor specific. As the method which 
> does this check is private static, this behavior cannot be overridden.
> In the class org.apache.cxf.ws.rm.persistence.jdbc.RMTxStore the while 
> initializing the RM store the method isTableExistsError is hard coded with 
> vendor error codes for derby and oracle, so if we use any other RDBMS 
> underneath then we run into errors that the tables already exists. As this 
> method is private static this cannot be overridden either.
> Please provide means to have vendor independent checks.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to