You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Marcin (Created) (JIRA)" <ji...@apache.org> on 2012/01/03 14:05:39 UTC

[jira] [Created] (CAMEL-4854) BAM - database constraint violation when restaring application

BAM - database constraint violation when restaring application
--------------------------------------------------------------

                 Key: CAMEL-4854
                 URL: https://issues.apache.org/jira/browse/CAMEL-4854
             Project: Camel
          Issue Type: Bug
          Components: camel-bam
    Affects Versions: 2.8.2
            Reporter: Marcin


Take BAM example from http://camel.apache.org/bam-example.html  (or any other one, it doesn't matter).

Here is the one I'm using:

        ActivityBuilder request = activity("eaiBroker:topic:SOME_TOPIC?concurrentConsumers=1").name("Request")
                .correlate(xpath("/MessageRequest/@Id").stringResult());

        ActivityBuilder response = activity("eaiBroker:topic:SOME_OTHER_TOPIC?concurrentConsumers=1").name("Response")
                .correlate(xpath("MessageResponse/@Id").stringResult());

        response
                .starts().after(request.completes())
                .expectWithin(seconds(15))
                .errorIfOver(seconds(30))
                .to("log:com.eai?level=error");



 First run of the application and everything works. Restart application and try to activate one of BAM rules, there will be an exception that database constraint has been violated. Every time application is started, Camel tries to do following sql insert

insert into CAMEL_ACTIVITYDEFINITION (name, processDefinition_id, id) values (?, ?, ?)

but name columne must be unique in CAMEL_ACTIVITYDEFINITION .


Workaround for this is to purge BAM tables every time you want to restart the application, but it's not a solution.

--
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

        

[jira] [Commented] (CAMEL-4854) BAM - database constraint violation when restaring application

Posted by "Marcin (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13178749#comment-13178749 ] 

Marcin commented on CAMEL-4854:
-------------------------------

I tried to solve on my own, and the problem occurs because of invalid XML configuration. The BAM example that is in binary distribution 

<bean id="activities" class="org.apache.camel.example.bam.MyActivities">
        <property name="jpaTemplate" ref="jpaTemplate"/>
        <property name="transactionTemplate" ref="transactionTemplate"/>
    </bean>

should be changed to 

<bean id="activities" class="org.apache.camel.example.bam.MyActivities">
        <constructor-arg><ref bean="jpaTemplate"/></constructor-arg>
        <constructor-arg><ref bean="transactionTemplate"/></constructor-arg>
    </bean>

Second version calls valid constructor for ProcessBuilder which creates ProcessName. The first one leaves process name as null.
                
> BAM - database constraint violation when restaring application
> --------------------------------------------------------------
>
>                 Key: CAMEL-4854
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4854
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-bam
>    Affects Versions: 2.8.2
>            Reporter: Marcin
>
> Take BAM example from http://camel.apache.org/bam-example.html  (or any other one, it doesn't matter).
> Here is the one I'm using:
>         ActivityBuilder request = activity("eaiBroker:topic:SOME_TOPIC?concurrentConsumers=1").name("Request")
>                 .correlate(xpath("/MessageRequest/@Id").stringResult());
>         ActivityBuilder response = activity("eaiBroker:topic:SOME_OTHER_TOPIC?concurrentConsumers=1").name("Response")
>                 .correlate(xpath("MessageResponse/@Id").stringResult());
>         response
>                 .starts().after(request.completes())
>                 .expectWithin(seconds(15))
>                 .errorIfOver(seconds(30))
>                 .to("log:com.eai?level=error");
>  First run of the application and everything works. Restart application and try to activate one of BAM rules, there will be an exception that database constraint has been violated. Every time application is started, Camel tries to do following sql insert
> insert into CAMEL_ACTIVITYDEFINITION (name, processDefinition_id, id) values (?, ?, ?)
> but name columne must be unique in CAMEL_ACTIVITYDEFINITION .
> Workaround for this is to purge BAM tables every time you want to restart the application, but it's not a solution.

--
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

        

[jira] [Resolved] (CAMEL-4854) BAM - database constraint violation when restaring application

Posted by "Claus Ibsen (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-4854.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.9.1
                   2.8.4
         Assignee: Claus Ibsen

I fixed the ProcessBuilder in camel-bam to create the processor name if not explicit configured.
                
> BAM - database constraint violation when restaring application
> --------------------------------------------------------------
>
>                 Key: CAMEL-4854
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4854
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-bam
>    Affects Versions: 2.8.2
>            Reporter: Marcin
>            Assignee: Claus Ibsen
>             Fix For: 2.8.4, 2.9.1
>
>
> Take BAM example from http://camel.apache.org/bam-example.html  (or any other one, it doesn't matter).
> Here is the one I'm using:
>         ActivityBuilder request = activity("eaiBroker:topic:SOME_TOPIC?concurrentConsumers=1").name("Request")
>                 .correlate(xpath("/MessageRequest/@Id").stringResult());
>         ActivityBuilder response = activity("eaiBroker:topic:SOME_OTHER_TOPIC?concurrentConsumers=1").name("Response")
>                 .correlate(xpath("MessageResponse/@Id").stringResult());
>         response
>                 .starts().after(request.completes())
>                 .expectWithin(seconds(15))
>                 .errorIfOver(seconds(30))
>                 .to("log:com.eai?level=error");
>  First run of the application and everything works. Restart application and try to activate one of BAM rules, there will be an exception that database constraint has been violated. Every time application is started, Camel tries to do following sql insert
> insert into CAMEL_ACTIVITYDEFINITION (name, processDefinition_id, id) values (?, ?, ?)
> but name columne must be unique in CAMEL_ACTIVITYDEFINITION .
> Workaround for this is to purge BAM tables every time you want to restart the application, but it's not a solution.

--
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