You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Julian Cable (JIRA)" <ji...@apache.org> on 2011/06/25 00:51:47 UTC
[jira] [Created] (CAMEL-4152) jdbc idempotent repository - table
creation
jdbc idempotent repository - table creation
-------------------------------------------
Key: CAMEL-4152
URL: https://issues.apache.org/jira/browse/CAMEL-4152
Project: Camel
Issue Type: Improvement
Components: camel-sql
Affects Versions: 2.7.1
Environment: camels on any
Reporter: Julian Cable
Assignee: Christian Müller
I couldn't find any reference to using this with spring DSL. I came up with this which seems to work:
<bean id="myRepo" class="org.apache.camel.processor.idempotent.jdbc.JdbcMessageIdRepository">
<constructor-arg index="0" ref="myJDBC"/>
<constructor-arg index="1" value="foobar"/>
</bean>
<bean id="myJDBC" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="${myJDBC.uri}" />
<property name="username" value="${myJDBC.username}" />
<property name="password" value="${myJDBC.password}" />
</bean>
I think it would be better if the class had a default constructor and looked for properties.
Julian
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CAMEL-4152) jdbc idempotent repository - table
creation
Posted by "Julian Cable (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-4152?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Julian Cable updated CAMEL-4152:
--------------------------------
Labels: idempotent jdbc (was: docuentation idempotent jdbc)
Description:
It would be nice if the class caught the error if the table does not exist and tried to create it. If the create privilege is not available then a more informative exception can be raised to inform the user what needs creating.
I also suggest the schema is changed so that the fields are lower case as different database engines handle case differently and use incompatible quoting for mixed case tables (Oracle, MySql and Postgres are all slightly different).
Julian
was:
I couldn't find any reference to using this with spring DSL. I came up with this which seems to work:
<bean id="myRepo" class="org.apache.camel.processor.idempotent.jdbc.JdbcMessageIdRepository">
<constructor-arg index="0" ref="myJDBC"/>
<constructor-arg index="1" value="foobar"/>
</bean>
<bean id="myJDBC" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="${myJDBC.uri}" />
<property name="username" value="${myJDBC.username}" />
<property name="password" value="${myJDBC.password}" />
</bean>
I think it would be better if the class had a default constructor and looked for properties.
Julian
> jdbc idempotent repository - table creation
> -------------------------------------------
>
> Key: CAMEL-4152
> URL: https://issues.apache.org/jira/browse/CAMEL-4152
> Project: Camel
> Issue Type: Improvement
> Components: camel-sql
> Affects Versions: 2.7.1
> Environment: camels on any
> Reporter: Julian Cable
> Assignee: Christian Müller
> Labels: idempotent, jdbc
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> It would be nice if the class caught the error if the table does not exist and tried to create it. If the create privilege is not available then a more informative exception can be raised to inform the user what needs creating.
> I also suggest the schema is changed so that the fields are lower case as different database engines handle case differently and use incompatible quoting for mixed case tables (Oracle, MySql and Postgres are all slightly different).
> Julian
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CAMEL-4152) jdbc idempotent repository - table
creation
Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-4152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055153#comment-13055153 ]
Christian Müller commented on CAMEL-4152:
-----------------------------------------
I'm not sure if we should do this.
I agree it would be convenient for our users, but it's not so easy to handle all the databases well (it's much more work for Camel than for the user).
To be consistent, we also have to improve the JdbcAggregationRepository.
Other thoughts?
Christian
> jdbc idempotent repository - table creation
> -------------------------------------------
>
> Key: CAMEL-4152
> URL: https://issues.apache.org/jira/browse/CAMEL-4152
> Project: Camel
> Issue Type: Improvement
> Components: camel-sql
> Affects Versions: 2.7.1
> Environment: camels on any
> Reporter: Julian Cable
> Assignee: Christian Müller
> Labels: idempotent, jdbc
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> It would be nice if the class caught the error if the table does not exist and tried to create it. If the create privilege is not available then a more informative exception can be raised to inform the user what needs creating.
> I also suggest the schema is changed so that the fields are lower case as different database engines handle case differently and use incompatible quoting for mixed case tables (Oracle, MySql and Postgres are all slightly different).
> Julian
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CAMEL-4152) jdbc idempotent repository - table
creation
Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-4152?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christian Müller updated CAMEL-4152:
------------------------------------
Remaining Estimate: (was: 24h)
Original Estimate: (was: 24h)
> jdbc idempotent repository - table creation
> -------------------------------------------
>
> Key: CAMEL-4152
> URL: https://issues.apache.org/jira/browse/CAMEL-4152
> Project: Camel
> Issue Type: Improvement
> Components: camel-sql
> Affects Versions: 2.7.1
> Environment: camels on any
> Reporter: Julian Cable
> Assignee: Christian Müller
> Labels: idempotent, jdbc
>
> It would be nice if the class caught the error if the table does not exist and tried to create it. If the create privilege is not available then a more informative exception can be raised to inform the user what needs creating.
> I also suggest the schema is changed so that the fields are lower case as different database engines handle case differently and use incompatible quoting for mixed case tables (Oracle, MySql and Postgres are all slightly different).
> Julian
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CAMEL-4152) jdbc idempotent repository - table
creation
Posted by "Julian Cable (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-4152?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Julian Cable updated CAMEL-4152:
--------------------------------
Remaining Estimate: 24h (was: 1h)
Original Estimate: 24h (was: 1h)
> jdbc idempotent repository - table creation
> -------------------------------------------
>
> Key: CAMEL-4152
> URL: https://issues.apache.org/jira/browse/CAMEL-4152
> Project: Camel
> Issue Type: Improvement
> Components: camel-sql
> Affects Versions: 2.7.1
> Environment: camels on any
> Reporter: Julian Cable
> Assignee: Christian Müller
> Labels: idempotent, jdbc
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> It would be nice if the class caught the error if the table does not exist and tried to create it. If the create privilege is not available then a more informative exception can be raised to inform the user what needs creating.
> I also suggest the schema is changed so that the fields are lower case as different database engines handle case differently and use incompatible quoting for mixed case tables (Oracle, MySql and Postgres are all slightly different).
> Julian
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CAMEL-4152) jdbc idempotent repository - table
creation
Posted by "Julian Cable (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-4152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055162#comment-13055162 ]
Julian Cable commented on CAMEL-4152:
-------------------------------------
I think the minimum would be to detect the table not being there and raise an exception that explained the problem and how to fix it.
I think an SQL94 compliant create (with primary key on the two main fields) would be nice. If that fails, don't try anything clever, just raise a helpful exception.
Either way works for me.
Julian
> jdbc idempotent repository - table creation
> -------------------------------------------
>
> Key: CAMEL-4152
> URL: https://issues.apache.org/jira/browse/CAMEL-4152
> Project: Camel
> Issue Type: Improvement
> Components: camel-sql
> Affects Versions: 2.7.1
> Environment: camels on any
> Reporter: Julian Cable
> Assignee: Christian Müller
> Labels: idempotent, jdbc
>
> It would be nice if the class caught the error if the table does not exist and tried to create it. If the create privilege is not available then a more informative exception can be raised to inform the user what needs creating.
> I also suggest the schema is changed so that the fields are lower case as different database engines handle case differently and use incompatible quoting for mixed case tables (Oracle, MySql and Postgres are all slightly different).
> Julian
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira