Re: daoManager start/end/commit transaction problem

2005-08-04 Thread Clinton Begin
Three things: 1) You should only have one DAO manager, even with multiple databases. 2) In my opinion, your transactions should be at the service level.  Make more coarse grained service methods that demarcate transactional scope.  3) Be very careful with multiple start/commit/end blocks.  You

Re: Executing stored procedures

2005-08-04 Thread Clinton Begin
Two things: 1) What does "did not work" mean?  Was there an exception etc? 2) When working with nullable parameters and Oracle, you must specify the data type (an Oracle/JDBC requirement).  So use #input1:VARCHAR#, or whatever the type may be. Cheers, ClintonOn 8/2/05, Rao, Satish <[EMAIL PROTE

Re: Lazy loading

2005-08-04 Thread Oleg Shpak
Thanks a lot, Niels, I didn't have CGLIB on classpath and I overlooked the last line in EnhancedLazyResultLoader where it wraps objects. Oleg Niels Beekman wrote: Hi, Are you using CGLIB? If not, iBATIS uses the Java Proxy/Invocationhandler, which only handles interfaces. Somebody please co

RE: More complex example of a queryForMap call

2005-08-04 Thread Niels Beekman
I believe so yes, the docs say: The value of the map can either be the entire employee object, or another property from the employee object as specified in the optional second parameter called valueProperty. So when you do not specify the valueProperty-property it returns Student-objects otherwis

RE: Ibatis and Spring Framework

2005-08-04 Thread John Hurst
Hi, I use iBATIS with Spring. In fact I learned about iBATIS via Spring; I think the two together work very well. In addition to Richard's comments, I would add: - Common configuration mechanism across your whole project, and separation of configuration from your code. With Spring, your DAOs

Re: More complex example of a queryForMap call

2005-08-04 Thread Nathan Maves
Sweet wiki here I come!On Aug 4, 2005, at 1:30 PM, Larry Meadors wrote:Yes. Larry On 8/4/05, Nathan Maves <[EMAIL PROTECTED]> wrote: I would hope it is that simple but that leads me to ask about thelast parameter of thequeryForMap(String statementName, Object parameterObject, StringkeyProperty, St

Re: More complex example of a queryForMap call

2005-08-04 Thread Larry Meadors
Yes. Larry On 8/4/05, Nathan Maves <[EMAIL PROTECTED]> wrote: I would hope it is that simple but that leads me to ask about thelast parameter of thequeryForMap(String statementName, Object parameterObject, StringkeyProperty, String valueProperty);When using it with your below example would queryFo

Re: Ibatis and Spring Framework

2005-08-04 Thread rich oates
The Spring JDBC wrapper offers at least the following: - a further abstraction away from iBatis (which is useful if you wish to change the underlying persistence framework in the future) - common data access exceptions (i.e. the iBatis exceptions are mapped to spring exceptions. Again, useful if

Re: More complex example of a queryForMap call

2005-08-04 Thread Nathan Maves
I would hope it is that simple but that leads me to ask about the last parameter of the queryForMap(String statementName, Object parameterObject, String keyProperty, String valueProperty); When using it with your below example would queryForMap("studentStatement", null, "id", "fname"); r

RE: More complex example of a queryForMap call

2005-08-04 Thread Niels Beekman
I would say: SELECT id, fname, lname FROM students queryForMap("studentStatement", null, "id"); this would result in for example: 1 - Student1 2 - Student2 Or is this too simpleminded? Niels -Original Message- From: Nathan Maves [mailto:[EMAIL PROTECTED] Sent: donderdag 4 augu

RE: Lazy loading

2005-08-04 Thread Niels Beekman
Hi, Are you using CGLIB? If not, iBATIS uses the Java Proxy/Invocationhandler, which only handles interfaces. Somebody please correct me if I'm wrong. If you look into EnhancedLazyResultLoader you'll see that it does not only wrap instances of Collection. Hope this clarifies something, Niels --

Lazy loading

2005-08-04 Thread Oleg Shpak
Hello, I'm using lazy loading in iBatis, but this appears to fetch my object eagerly, effectively increasing the number of statements to exactly N+1. Lazy loading for collection does work however. I did some research and found that iBatis does not create proxies for objects, only for collections.

Re: empty String like nullValue

2005-08-04 Thread Kim Goings
On Aug 4, 2005, at 11:16 AM, Emiliano Armellin wrote: Hello is there away to specify that null strings will be setted to empty string ("") in object result map? Have I got use a TypeHandlerCallback? -- Emiliano Armellin W_ www.ateikon.com @_ [EMAIL PROTECTED] T_ +39 0422 452101

Lazy loading

2005-08-04 Thread Oleg Shpak
Hello, I'm using lazy loading in iBatis, but this appears to fetch my object eagerly, effectively increasing the number of statements to exactly N+1. Lazy loading for collection does work however. I did some research and found that iBatis does not create proxies for objects, only for collections.

empty String like nullValue

2005-08-04 Thread Emiliano Armellin
Hello is there away to specify that null strings will be setted to empty string ("") in object result map? Have I got use a TypeHandlerCallback? -- Emiliano Armellin W_ www.ateikon.com @_ [EMAIL PROTECTED] T_ +39 0422 452101

Re: cache timeout

2005-08-04 Thread Oleg Shpak
Hello, I'm using lazy loading in iBatis, but this appears to fetch my object eagerly, effectively increasing the number of statements to exactly N+1. Lazy loading for collection does work however. I did some research and found that iBatis does not create proxies for objects, only for collectio

More complex example of a queryForMap call

2005-08-04 Thread Nathan Maves
Given a student table id,fname,lname how would you make the call to return a Map of Students keys on the studentId? I think the manual is a bit confusing and I am going to create a wiki on the topic. Nathan

Re: cache timeout

2005-08-04 Thread Oleg Shpak
Hello, I'm using lazy loading in iBatis, but this appears to fetch my object eagerly, effectively increasing the number of statements to exactly N+1. Lazy loading for collection does work however. I did some research and found that iBatis does not create proxies for objects, only for collectio

Re: [SOLVED]: Dynamic Prepend and removal of "beginning" prepends

2005-08-04 Thread Nathan Maves
Abdullah,Can you send me the full sql map of the now working code?I can try and get something on the wiki today.NathanOn Aug 3, 2005, at 12:11 PM, Larry Meadors wrote:Yeah, the wiki is where we try to consolidate the "a-hah!" stuff like this. ;-) http://opensource.atlassian.com/confluence/oss/disp

Re: MalformedURLException: no protocol

2005-08-04 Thread Larry Meadors
Please send the complete stack trace. Larry On 8/4/05, Vlada Djurovic <[EMAIL PROTECTED]> wrote: Hi,Iam new user of iBATIS, and i have a weird problem. I searched thearchives and all over the internet, but can't find anything simmilar.I try to do a simple app using SQL-maps tutorial.This is how Is

Re: loggins (again)

2005-08-04 Thread Eugeny N Dzhurinsky
On Thu, Aug 04, 2005 at 04:33:18PM +0200, Guido Garc??a Bernardo wrote: > I'm not sure, but that is the problem I suffered running my application > under Tomcat 4.1.x. > Logs don't appear with Tomcat, but it works fine with any other server... > I don't know what is the solution... :( > iBatis 2.1.

Re: loggins (again)

2005-08-04 Thread Guido García Bernardo
I'm not sure, but that is the problem I suffered running my application under Tomcat 4.1.x. Logs don't appear with Tomcat, but it works fine with any other server... I don't know what is the solution... :( iBatis 2.1.5 removes commons-logging dependency, but I haven't had the chance to try it yet

Re: loggins (again)

2005-08-04 Thread Eugeny N Dzhurinsky
> I'm running the application at Jakarta tomcat 5.0, may be that's the clue? > An log statements from my application are logged w/o any problems. and log4j-1.2.9.jar is located under WEB-INF/lib in my application, and is working fine, just the iBATIS don't see it for some reason :( -- Eugene N D

Re: loggins (again)

2005-08-04 Thread Eugeny N Dzhurinsky
On Thu, Aug 04, 2005 at 03:57:34PM +0200, Guido Garc??a Bernardo wrote: > Maybe you are facing with a commons-logging problem: > http://mail-archives.apache.org/mod_mbox/incubator-ibatis-user-java/200504.mbox/[EMAIL > PROTECTED] > > Try to make sure there's only one version of log4j in your envir

Re: queryForList with skip max and groupBy feature

2005-08-04 Thread Michal Malecki
Ok, so I'll use ResultHandler great request for developers - please make javadoc for queryForList more precise! Michal Malecki Subject: RE: queryForList with skip max and groupBy feature i had a look at the src and it is not objects.. It sets the skip on the resultset... __

RE: queryForList with skip max and groupBy feature

2005-08-04 Thread James, Steven
i had a look at the src and it is not objects.. It sets the skip on the resultset... From: Michal Malecki [mailto:[EMAIL PROTECTED] Sent: Thu 04/08/2005 15:04 To: user-java@ibatis.apache.org Subject: Re: queryForList with skip max and groupBy feature This is

Re: queryForList with skip max and groupBy feature

2005-08-04 Thread Michal Malecki
This is precisely what I was asking for - are the parameters "max" and "skip" in the queryForList concerning number of rows or objects. If rows - I understand that I must use ResultHandler; but IMHO it's not clearly written in the doc what are these two parameters Michal Malecki Subject: RE: query

Re: loggins (again)

2005-08-04 Thread Guido García Bernardo
Maybe you are facing with a commons-logging problem: http://mail-archives.apache.org/mod_mbox/incubator-ibatis-user-java/200504.mbox/[EMAIL PROTECTED] Try to make sure there's only one version of log4j in your environment, and adding the following line: log4j.logger.java.sql.PreparedStatement=DE

RE: queryForList with skip max and groupBy feature

2005-08-04 Thread James, Steven
At a guess i would say dont use this way as it would be hard to predict the number of rows due to the joins unless this is a constant of course.. How are you calculating the number of row to return as you have a join a left join at that... Due to the joins you will get more than one row per obj

Re: queryForList with skip max and groupBy feature

2005-08-04 Thread Michal Malecki
part of sql is: select ls_name,le_id,le_level,le_message,le_location,le_logger, le_thread,le_throwable,le_timestamp,le_ndc,lk_name,lea_value from log_sources, log_events LEFT OUTER JOIN log_event_attributes on (lea_event = le_id) LEFT OUTER JOIN log_keys ON (lk_id = lea_key) where ls_id = le_source

loggins (again)

2005-08-04 Thread Eugeny N Dzhurinsky
I still facing the problems with the SQL logging :( I'm using the Log4J and my simple configuration below: log4j.rootLogger=DEBUG, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPatter

RE: queryForList with skip max and groupBy feature

2005-08-04 Thread James, Steven
i meant number of objects returned... Caqn u also post the sql.. Cheers, Steve From: Michal Malecki [mailto:[EMAIL PROTECTED] Sent: Thu 04/08/2005 14:15 To: user-java@ibatis.apache.org Subject: Re: queryForList with skip max and groupBy feature as far as i a

Re: queryForList with skip max and groupBy feature

2005-08-04 Thread Michal Malecki
as far as i am aware there is no such feature so send some more details ie the xml file with query? About which feature are you talking about? groupby: regards Michal Malecki Dzial Uslug Sieciowych

Re: Multiple select queries in one select tag

2005-08-04 Thread Nathan Maves
I understand that :) But in this case you would be combining something like em_num with dept_num. In this case you would have to place dummy columns with either a null of 0 as a place holder. I still think that my join is way cleaner and more performant. Nathan On Aug 4, 2005, at 12:42

RE: queryForList with skip max and groupBy feature

2005-08-04 Thread James, Steven
as far as i am aware there is no such feature so send some more details ie the xml file with query? From: Michal Malecki [mailto:[EMAIL PROTECTED] Sent: Thu 04/08/2005 12:52 To: user-java@ibatis.apache.org Subject: queryForList with skip max and groupBy feature

MalformedURLException: no protocol

2005-08-04 Thread Vlada Djurovic
Hi, Iam new user of iBATIS, and i have a weird problem. I searched the archives and all over the internet, but can't find anything simmilar. I try to do a simple app using SQL-maps tutorial. This is how Is aet up data source in sqlMapConfig file:

queryForList with skip max and groupBy feature

2005-08-04 Thread Michał Małecki
Hello, I am using groupBy feature to build complex objects, whith array of other objects. Yestarday I have discovered my mistake in sql - I have used Limit and offset in postgresql sql, which caused that I got less objects than I should (few rows create one object). Then I recalled- ibatis has quer

Ibatis and Spring Framework

2005-08-04 Thread Abdullah Kauchali
Can someone who has experience with the Spring Framework please help me explain briefly what advantages it could afford /along with/ the use of Ibatis. What is it that the Spring offers that IBatis does not? (I know that Spring is multi-facetted, it does AOP stuff etc - but I am asking specifi

daoManager start/end/commit transaction problem

2005-08-04 Thread Darek Dober
Hi I use petstore as example so I have: affairService and debtorService which gives me method like updateAffair(Domain affair) and updateDebtor(Domain debtor) Now I want them to be executed in one transaction I try to do something like this update() { ... try { affairService.getDaoManager().st