RE: How can I change datasource connect info on the fly w/iBATIS and Spring?

2007-04-16 Thread Kyohyoh Choh
Hello Thank you for point out the cachemodel. To switch different datasources for diffrent users and retrieve the data correctly, we don't want to iBATIS to cache the data, though it maybe have some performance impart. In the sqlmapconfig.xml, we do not turn the cacheModelsEnabled="false", so

RE: How can I change datasource connect info on the fly w/iBATIS and Spring?

2007-04-16 Thread Chris Lamey
Hello, I am wondering if you are using the cache in iBATIS via the cacheModel attribute in the sqlmap xml? I would think that switching the datasource out from under the SqlMapClient would cause results from the various data sources to get merged into the SqlMapClient's cache. As far as I kno

Re: How can I change datasource connect info on the fly w/iBATIS and Spring?

2007-04-16 Thread Kyohyoh Choh
Hello Our application has a similar requirement that need to switch among multiple datasources dynamicly, although we do not need to create datasource in fly. We defined the datasources in ApplicationContex.xml, then using getBean to load the datasource depand on the user's request parameter an

RE: what is the correct SQL for IN ?

2007-04-16 Thread xianwinwin
thank you! IN ?state? WORKS! where in the docs does it explain this issue? thanks again Poitras Christian wrote: > > Make a List of states (or an array) and use the iterate tag (see the > documentation). > > Another possibility is to use > > LG.state IN ?state? >

RE: what is the correct SQL for IN ?

2007-04-16 Thread Poitras Christian
Make a List of states (or an array) and use the iterate tag (see the documentation). Another possibility is to use LG.state IN ?state? But I don't recommend this in your case. You should really use the iterate tag. Christian -Original Message- From:

what is the correct SQL for IN ?

2007-04-16 Thread xianwinwin
Hi there, I wonder how to implement this query in ibatis as it gives me an error message. query: . AND LG.state IN ('ny', 'bj') (in plain sql) in ibatis: LG.state IN #state:VARCHAR# error: You have an error in your SQL syntax; check the manual t

RE: converting iBATIS framework DAOs to the Spring Framework

2007-04-16 Thread Meindert
Ok thanks! I had to change the header for the spring config file to make that work: http://www.springframework.org/dtd/spring-beans.dtd";> To http://www.springframework.org/schema/beans"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:aop="http://www.springfr

Re: converting iBATIS framework DAOs to the Spring Framework

2007-04-16 Thread Tom Duffey
See below. On Apr 16, 2007, at 9:46 AM, Meindert wrote: Thus larry could you add the following to finish the converting from IbatisDao to springDao with ibatis sqlmaps? 3) Spring config Add the following to the spring config file; class="org.springframework.jdbc.datasource.DataSourceT

RE: converting iBATIS framework DAOs to the Spring Framework

2007-04-16 Thread Meindert
Ok, have to stay on that track then ;-) After adding the jar from sourceforce (cglib-2.2_beta1.jar) I get the message; org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountService' defined in ServletContext resource [/WEB-INF/spring.xml]: Initializatio

RE: converting iBATIS framework DAOs to the Spring Framework

2007-04-16 Thread Poitras Christian
One danger of adding cglib to your classpath is that lazy objects created by iBATIS will be harder to serialize. An example of serialization of "lazy" objects given by Paul here. http://opensource.atlassian.com/confluence/oss/display/IBATIS/Lazy+loadi ng+issues Beside this problem, I don't see an

Re: converting iBATIS framework DAOs to the Spring Framework

2007-04-16 Thread Tom Duffey
On Apr 16, 2007, at 8:27 AM, Meindert wrote: I don't think that adding cglib will fix it, the service classes seem to need an interface to be able to generate the proxy. Please correct me if I'm wrong. Yes, it should fix the problem. Spring typically uses JDK-based proxies when the targe

RE: converting iBATIS framework DAOs to the Spring Framework

2007-04-16 Thread Meindert
I don't think that adding cglib will fix it, the service classes seem to need an interface to be able to generate the proxy. Please correct me if I'm wrong. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Larry Meadors Sent: 16 April 2007 03:10 PM To: user

Re: converting iBATIS framework DAOs to the Spring Framework

2007-04-16 Thread Larry Meadors
Hmm, I think I'd rather add cglib than give up transactions in the service layer. It's another jar, but reduces complexity (that's unusual when you *add* a jar), and puts transaction management where it belongs, IMO. Larry On 4/16/07, Meindert <[EMAIL PROTECTED]> wrote: Had a closer look at i

RE: JPetstore and Linux problem

2007-04-16 Thread confusionvalley
It looks like the problem is in the arguments to the SQL queries. In the Category.xml file if I use: SELECT CATID AS categoryId, NAME, DESCN AS description FROM category WHERE CATID = 'FISH' Everything runs fine and the FISH category is shown. But if I chan

JPetstore and Linux problem

2007-04-16 Thread Nuno Rodrigues
Hello all, After installing JPetstore 5 on Windows with tomcat 5.5.20 + Mysql 5 I tried to install it under Linux but the things didn't run very well. After filling the database and deploying the application I had two errors when clicking the viewCategory page. Both errors happened due to t

RE: converting iBATIS framework DAOs to the Spring Framework

2007-04-16 Thread Meindert
Hi Christian, Had a closer look at it and the logical reason the proxy could not be generated is the fact the service classes (in JPetstore) don't use an interface. I would like to keep it that way, because the reason's I heard for giving it an interface are not convincing (reasons like 'it is

RE: converting iBATIS framework DAOs to the Spring Framework

2007-04-16 Thread Meindert
Hi Chris, I did see that in the error message :-). Do you have any additional information about why would I need to add CGLIB to enable transactions? It does give that kind io info on the Project Information; It is used by AOP, testing, data access frameworks to generate dynamic proxy object