On Thu, Dec 17, 2009 at 3:29 PM, Aleksey Masny <[email protected]> wrote:
>
> I use Camel and iBatis component. And i need pool data in one database,
> transform it and insert to another database.
>
> Therefore I have two different SqlMapConfig*.xml files (SqlMapConfigWMS.xml
> and SqlMapConfigJDE.xml) in  src/resources directory. SqlMapConfigWMS.xml
> includes link to WMS_selectMissingBoms statement and SqlMapConfigJDE.xml
> includes link to JDE_testInsert statement.
>
> My route:
>
> from("ibatis:WMS_selectMissingBoms?" +
>                        "maxMessagesPerPoll=1&" +
>                        "initialDelay=1000&" +
>                        "delay=60000").//pool in one database
>                to("bean:helper?method=mapBomToEvent").//transform
>                to("ibatis:JDE_testInsert?statementType=Insert")//insert to 
> another
> database
>
> But iBatis component uses only one, first found or default SqlMapConfig.xml.
> Therefore camel-ibatis throw exception
> com.ibatis.sqlmap.client.SqlMapException: There is no statement named
> JDE_testInsert in this SqlMap.
>
> I think, for resolve this problem I can use two ibatis istanсes and
> configure its with different SqlMapConfig*.xml files? For example
> "ibatis_WMS" and "ibatis_JDE", and use this id in endpoint url? But how
> manualy create instance ibatis component with predefined configuration file?
>
> Or do you know of any other solution?
>

Hi

I think you can refer to other xml files in the default SqlMapConfig.xml file

for example from this
https://svn.apache.org/repos/asf/camel/trunk/components/camel-ibatis/src/test/resources/SqlMapConfig.xml

You got this line
  <sqlMap resource="org/apache/camel/component/ibatis/Account.xml"/>

You can just add another <sqlMap> for other files.



> Thank you and best regards,
> Aleksey Masny.
> --
> View this message in context: 
> http://old.nabble.com/How-to-use-multiple-dataSource-in-camel.iBatis--tp26828799p26828799.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to