RE: Problem with dynamic query.

2006-03-21 Thread Niels Beekman
You cannot use an iterated property in the decision tags. I believe there is a JIRA issue for this. --> not allowed Niels -Original Message- From: Daniel Pitts [mailto:[EMAIL PROTECTED] Sent: woensdag 22 maart 2006 2:44 To: user-java@ibatis.apache.org Subject: Problem with dynamic quer

Problem with dynamic query.

2006-03-21 Thread Daniel Pitts
I'm trying the following dynamic query, and ibatis throws an exception on initialization. (Even before I call the query) The exception is a Probe exception, cannot find ordinal for JavaBean , caused by NumberFormatException from string "". Can anyone tell me what I'm doing wrong? Query:

Re: multiple setters

2006-03-21 Thread Ben Munat
Yeah, it appears that it can create *really* screwy problems for ibatis. We were seeing integration tests passing completely on one machine, passing individually but failing as part of a suite on another machine, and never passing at all on a third machine! After poking at it a while I started

Re: multiple setters

2006-03-21 Thread Nathan Maves
Ahhh yeah... not good don't have them. :) They are against the java bean specification. Nathan On Mar 21, 2006, at 4:38 PM, Ben Munat wrote: Hey All... I seem to remember someone talking recently about difficulties with a property set by ibatis having multiple setters. Does this ring a be

multiple setters

2006-03-21 Thread Ben Munat
Hey All... I seem to remember someone talking recently about difficulties with a property set by ibatis having multiple setters. Does this ring a bell? b

Re: Multiple selectKey in Oracle

2006-03-21 Thread Sven Boden
Because there can only be 1 return value. You can have multiple keys generated in Oracle per row, but you can only return one. Sven Folashade Adeyosoye wrote: Has anyone got this to work for them. I find out that the second selectKey does not not work too well select seq_one f

Multiple selectKey in Oracle

2006-03-21 Thread Folashade Adeyosoye
Has anyone got this to work for them. I find out that the second selectKey does not not work too well       select seq_one from dual           select seq_two from dual         insert into TABLE_NAME (column1, column2, column3) values (#col1#, #col2#, #col3#)

RE: Complex property question

2006-03-21 Thread Niels Beekman
Hi, You defined the following: ... some more When you access the 'shipToAddress' property, iBATIS passes the value of the specified column 'ship_to_address' to the specified select query ' PurchaseHdrAddr.getPurchaseHdrAddr_shipTo'. This value is as far as I can see a java.lang.String. The

RE: Very slow query

2006-03-21 Thread Nicolas Fajersztejn
OK. Another question that came up to my mind: The query takes now about 50ms, but I know that the SQL execution part takes just 8ms (as JDBC shows). So, I guess the rest of the time is used to open the connection and create the statement and so on... is this true or is most of this time used to b

RE: Abator and Table join

2006-03-21 Thread Tony Qian
Rashmi, Thanks for response. I figured out the problem.  All Abator generated configuration files have name space. The problem was i set useStatementNamespaces in sqlMap configuration file to 'false".  Once I set to true. Everything worked fine. The error message is not very clear. thanks, To

Re: Very slow query

2006-03-21 Thread Larry Meadors
On 3/21/06, Nicolas Fajersztejn <[EMAIL PROTECTED]> wrote: Which of the 2 solutions should I use? Passing BigDecimal and using #value# will most likely be faster if you have more iterations.Larry

Re: Could not find resource error

2006-03-21 Thread Janluc
Yeah! That worked! I am *so* proud of my first working sqlmap insert! I told everbody in my room and was looked in bewilderment... From the Application.java class: SystemElement se = new SystemElement(); se.setSeName("test"); se.setSeType("test type"); se.setSeDescription("description b

Re: Abator Primary Key Forcement

2006-03-21 Thread Skrach
I agree that the primary key isn't guranteed when using views, my problem seems a bit specialistic :-) Your idea of using Abator generated Example DAO's is nice (and flexible), but I don't want to clutter my DAO's with Example* classes just for PrimaryKey selection (yes, may i could use them else

Re: Could not find resource error

2006-03-21 Thread Jeff Butler
Wow!  Great job on figuring this out.  You're so close...   I think the only thing you need to change is on your insert statement:   sqlMap.insert("NAMESPACE.abatorgenerated_insert", se);   Where NAMESPACE is the namespace of the generated SQL Map - you can see it on the element in the XML file. 

Re: Abator Primary Key Forcement

2006-03-21 Thread Jeff Butler
Interesting idea, but I think that would be a little misleading.  Since a view doesn't have a primary key, a "selectByPrimaryKey" method would seem strange.   You can accomplish this function using the selectByExample method and writing your own "pseudo primary key".  For example:   public class Ps

Re: Could not find resource error

2006-03-21 Thread Janluc
Thanks Jeff, following your suggestions I investigated those arcane classloader issues and I came up with a partially satisfactory solution. Let me try to explain what I was trying to do: First I "bundled" all iBatis jars and the MySQL J/Connector jar into an Eclipse plugin, by using the "New Plu

RE: Very slow query

2006-03-21 Thread Nicolas Fajersztejn
Here is the code. It usually returns between 0 and 20 rows. The whole method executes in 6-10 ms depending on the rows returned.     private boolean allEPICFiltersClosedOrCalclosed(int obsID) throws SQLException     {     long t1 = System.currentTimeMillis();        boolean filte

RE: Very slow query

2006-03-21 Thread Nicolas Fajersztejn
Yes, there is unique index on (obsid,expno) But my point remains the same, without parameter conversion the query runs in 50ms and with parameter conversion in 1500ms, so I guess there is where the problem lies. And I need to run this query ~1000 times (one per obsid), meaning 1000 * 1500ms which

Abator Primary Key Forcement

2006-03-21 Thread Skrach
Hi, I’m currently evaluating Abator (which I’m really impressed off so far!) and came over the following limitation/idea: During creation of Maps/DAOs/Models, Primary Key classes are automatically created, if PK’s are found on the DB-Table. For sure, this mechanism doesn’t work for views (which

RE: Very slow query

2006-03-21 Thread Niels Beekman
Can we see the full code of your JDBC performance measurement and give us an indication about the amount of rows the query returns? Have you tried to explicitly define the parameterClass, using 'decimal' or 'java.math.BigDecimal'? Niels -Original Message- From: Nicolas Fajersztejn [mailt

Re: Very slow query

2006-03-21 Thread Nicolas Fajersztejn
Hi Nathan, the obsid type is Numeric(6,0)  (I'm using a Sybase DB but I think it maps to the number(p,s) type in Orcacle) CREATE TABLE dbo.exposures (     obsid numeric(6,0) NOT NULL,     inst  varchar(5) NOT NULL,     expno numeric(5,0) NOT NULL,     expid

Re: Very slow query

2006-03-21 Thread Nathan Maves
Nicolas,I am guessing that there is a type mismatch from your db to your parameter.  Please post both the table definition and your bean.if the DB field is a VARCHAR and your parameter is an Integer it can cause problems.id = '123' will have a different performance then id = 123If that is the case

Re: Very slow query

2006-03-21 Thread Nicolas Fajersztejn
Still taking the same time. I tried other query passing a String parameter and it takes about 400ms (which is considerably less than 1500ms) but seems a lot of time to me anyway. With JDBC it takes 8 ms!!! How long is it suppose to take this conversion with iBatis??? Has anybody experienced sim

RE: Very slow query

2006-03-21 Thread seyhan.basmaci
Hi,   Get your running query from sqlarea using select * from v$sqlarea where sql_text like '%FROM xsa..exposures%'   using an explain plan tool , check your running query whether using index!!!   Probably there is a type mismatch between obsid column and bind variable.. If so, you

Re: Very slow query

2006-03-21 Thread Nathan Maves
hmmm... did you try to specify the JDBC type on that column?obsid = #obsid:NUMERIC#I am running out of ideas :)NathanOn Mar 21, 2006, at 7:25 AM, Nicolas Fajersztejn wrote: Hi Nathan, the obsid type is Numeric(6,0)  (I'm using a Sybase DB but I think it maps to the number(p,s) type in Orcacle) C

Re: Very slow query

2006-03-21 Thread Nicolas Fajersztejn
Hi again, I have tried all these things you are suggesting: - setting cacheModelsEnabled to false - run the query several times in a loop - disable logging. and still I get the same result. But to me this question is very simple. If I change #value# for the actual number (i.e. 100) in the q

RE: Very slow query

2006-03-21 Thread seyhan.basmaci
obsid column defined as primary key or not ? is there any index on it, if not , the number of records for the same obsid can affect response time, with jdbc using next() method it may take 8 ms for the fist record , probably ibatis getting all of the matcing records!!! -Original M

RE: Abator and Table join

2006-03-21 Thread Rashmi Dave
Hi Tony,   Can you paste the code snippet which calls this query?   Thanks ~Rashmi   From: Tony Qian [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 21, 2006 3:12 AM To: user-java@ibatis.apache.org Subject: Abator and Table join   All, I'm using Abator generated code for