Inserting lists

2008-04-18 Thread Koka Kiknadze
Yesterday I understood that I'm writing loops to insert a lists of objects way too often. I think implementing methods like: insertList("insertSingleSomeObject",List)(with "insertSingleSomeObject" beeing sqlmap entry for inserting single object) batchInsert("insertSingleSomeObject",List) (wi

iBATIS insert does not execute

2008-04-18 Thread Chris Marshall
I have spent a couple of days on this and have read the FAQ and googled without success, so hope I can get some help: I am trying to persist an instance of the class: public class Role { private Integer roleid; private Integer parentid; private String name; private String

Re: iBATIS insert does not execute

2008-04-18 Thread Brandon Goodin
Is this the only insert that is not working for you? Do you have others that are working? What version of iBATIS are you using? Brandon Goodin On Fri, Apr 18, 2008 at 7:10 AM, Chris Marshall <[EMAIL PROTECTED]> wrote: > I have spent a couple of days on this and have read the FAQ and > googled wi

Re: iBATIS insert does not execute

2008-04-18 Thread Chris Marshall
Thanks for you rapid reply Brandon. It appears to be on all tables, but read and delete operate perfectly. Versions are: ibatis 2.3.0.677 mysql connector 5.0.8 mysql 5.0.51 jre jdk 1.6.0_04 Thanks, Chris On 18/04/2008, Brandon Goodin <[EMAIL PROTECTED]> wrote: > Is this the only insert that is

Re: iBATIS insert does not execute

2008-04-18 Thread Chris Marshall
Further to my previous reply - I have checked all field values to be correct, with only the primary autogenerated key being null. Regards Chris On 18/04/2008, Brandon Goodin <[EMAIL PROTECTED]> wrote: > Is this the only insert that is not working for you? Do you have others that > are working? Wha

AW: iBATIS insert does not execute

2008-04-18 Thread Leucht, Axel
Can you describe the database table structure you're working on? /Axel >>-Ursprüngliche Nachricht- >>Von: Chris Marshall [mailto:[EMAIL PROTECTED] >>Gesendet: Freitag, 18. April 2008 16:02 >>An: user-java@ibatis.apache.org >>Betreff: Re: iBATIS insert does not execute >> >> >>Further to

Re: iBATIS insert does not execute

2008-04-18 Thread Chris Marshall
Thanks for your reply Axel I think that the problem is related to passing a null primary key in the insert statement when the key is autogenerated (by MySQL). What is the best practice here? I have tried the following MySQL specific SqlMap snippet with success, but was hoping for a solution porta

Re: iBATIS insert does not execute

2008-04-18 Thread Larry Meadors
I pass null in all the time for that, so that seems kind of unlikely (of course mine is M$SQL-2K5). Maybe you could try jdbc? If that doesn't work, we know it's not ibatis. If it does, then we may need to step through the code and see where it's failing... Larry On Fri, Apr 18, 2008 at 8:29 AM,

Re: iBATIS insert does not execute

2008-04-18 Thread Brandon Goodin
What is your overall plan for deployment. Do you have sql scripts that get run against the target database to build the tables and such? How will you configure the connection url? What i've done in the past is to simply have a property file that contains the select key sql in it. I pass this proper

Re: iBATIS insert does not execute

2008-04-18 Thread Chris Marshall
Sorry to bug you again but I think that the problem is related to passing a null primary key in the insert statement when the key is autogenerated (by MySQL). What is the best practice here? I have tried the following MySQL specific SqlMap snippet with success, but was hoping for a solution portab

Re: iBATIS insert does not execute

2008-04-18 Thread Chris Marshall
Thanks for the tip Brandon, That will certainly solve the portability issue and fits well with the way we have structured our system. The selectKey approach is suitable given your suggestion. Thanks Chris On 18/04/2008, Brandon Goodin <[EMAIL PROTECTED]> wrote: > What is your overall plan for depl

sqlmapconfig dirs or wildcards

2008-04-18 Thread Markus Pscheidt
Hi everyone! According to the docs, for a set of sqlmap config files, each one needs to be defined by lines like: ... Is there a possibility instead to define a directory in which all my sqlmap config files reside? Something like: or alternatively wildcards? Something like: If there ar

Re: sqlmapconfig dirs or wildcards

2008-04-18 Thread Koka Kiknadze
Well, as much as I know there's no support for wildcards :( >are there reasons against implementing them? Guess no, maybe just restricted developer resources? IMO, after getting rid of much (too much, too too much) of manual coding with the help of abator (now it's ibator) I think that it could a

"Connection already closed"

2008-04-18 Thread Reuben Firmin
I'm using Ibatis 2.3.1. I've recently started getting this error; any ideas on how to debug? java.sql.SQLException: Already closed. org.apache.commons.dbcp.PoolableConnection:84 close org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper:181 close org.springframework.jdbc.datasource