M. Goodell | 1 Feb 2009 01:44
Picon

RE: SQL-Map / CDATA Performance Issue

I downloaded this documentation from the website. I am assuming since it's
the only Developers Guide available on the website that it was the latest
version. Am I mistaken? Where can I get the latest version of the docs?

-----Original Message-----
From: Chema [mailto:demablogia <at> gmail.com]
Sent: Saturday, January 31, 2009 2:18 PM
To: user-java <at> ibatis.apache.org
Subject: Re: SQL-Map / CDATA Performance Issue

Yes, yours is old.

Mine is dated on November 30, 2006  (2.3.x )

2009/1/31 M. Goodell <mgglist <at> comcast.net>:
> Thanks for your help. I do not see a reference to statementCaching in my
> version of the docs.
>
> See:
>
http://svn.apache.org/repos/asf/ibatis/trunk/java/ibatis-2/ibatis-2-docs/en/
> iBATIS-SqlMaps-2_en.pdf
>
> Is there more recent docs available other than the ones I have?
>
> -----Original Message-----
> From: Chema [mailto:demablogia <at> gmail.com]
> Sent: Saturday, January 31, 2009 1:54 PM
> To: user-java <at> ibatis.apache.org
> Subject: Re: SQL-Map / CDATA Performance Issue
(Continue reading)

M. Goodell | 1 Feb 2009 02:00
Picon

RE: SQL-Map / CDATA Performance Issue


Here is a log from a 10 record insertion. (My log4j set to ALL)

log4j2009-01-31 17:57:30,093 main org.springframework.core.CollectionFactory
TRACE - Creating [java.util.concurrent.ConcurrentHashMap]
log4j2009-01-31 17:57:30,093 main org.springframework.core.CollectionFactory
TRACE - Creating [java.util.concurrent.ConcurrentHashMap]
log4j2009-01-31 17:57:30,093 main org.springframework.core.CollectionFactory
TRACE - Creating [java.util.concurrent.ConcurrentHashMap]
log4j2009-01-31 17:57:30,093 main org.springframework.core.CollectionFactory
TRACE - Creating [java.util.concurrent.ConcurrentHashMap]
log4j2009-01-31 17:57:30,093 main org.springframework.core.CollectionFactory
TRACE - Creating [java.util.concurrent.ConcurrentHashMap]
log4j2009-01-31 17:57:30,093 main org.springframework.core.CollectionFactory
TRACE - Creating [java.util.concurrent.ConcurrentHashMap]
log4j2009-01-31 17:57:30,093 main org.springframework.core.CollectionFactory
TRACE - Creating [java.util.concurrent.ConcurrentHashMap]
log4j2009-01-31 17:57:30,093 main org.springframework.core.CollectionFactory
TRACE - Creating [java.util.concurrent.ConcurrentHashMap]
log4j2009-01-31 17:57:30,093 main org.springframework.core.CollectionFactory
TRACE - Creating [java.util.concurrent.ConcurrentHashMap]
log4j2009-01-31 17:57:30,125 main
org.springframework.beans.factory.xml.XmlBeanDefinitionReader INFO - Loading
XML bean definitions from class path resource [spring.xml]
log4j2009-01-31 17:57:30,140 main
org.springframework.beans.factory.xml.DefaultDocumentLoader DEBUG - Using
JAXP provider
[com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl]
log4j2009-01-31 17:57:30,203 main
org.springframework.beans.factory.xml.PluggableSchemaResolver TRACE - Trying
(Continue reading)

Kai Grabfelder | 1 Feb 2009 14:56
Picon
Favicon

Re: SQL-Map / CDATA Performance Issue

Hi,

looks like the pdf in svn is outdated. Please use the open office source instead
(http://svn.apache.org/repos/asf/ibatis/trunk/java/ibatis-2/ibatis-2-docs/en/iBATIS-SqlMaps-2_en.sxw).

I've opened a Jira Issue to address this:

https://issues.apache.org/jira/browse/IBATIS-578

btw: statementCachingEnabled is set to true by default, so if you didn't disable it it should be already on

Regards

Kai

--- Original Nachricht ---
Absender: M. Goodell
Datum: 01.02.2009 01:44
> I downloaded this documentation from the website. I am assuming since it's
> the only Developers Guide available on the website that it was the latest
> version. Am I mistaken? Where can I get the latest version of the docs?
> 
> -----Original Message-----
> From: Chema [mailto:demablogia <at> gmail.com]
> Sent: Saturday, January 31, 2009 2:18 PM
> To: user-java <at> ibatis.apache.org
> Subject: Re: SQL-Map / CDATA Performance Issue
> 
> 
> Yes, yours is old.
(Continue reading)

Kai Grabfelder | 1 Feb 2009 15:18
Picon
Favicon

Re: Using iBatis outside servlet container

Theres a Mock JNDI implementation within the spring library. We are using it for several productive batch
application.

http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/mock/jndi/package-summary.html

Regards

Kai

--- Original Nachricht ---
Absender: Ian Zabel
Datum: 30.01.2009 18:10
> This is how I create a mock JNDI datasource for our unit tests to match the
> one we normally get from Tomcat:
> // Create initial context
>             System.setProperty( Context.INITIAL_CONTEXT_FACTORY,
> "org.apache.naming.java.javaURLContextFactory" );
>             System.setProperty( Context.URL_PKG_PREFIXES,
> "org.apache.naming" );
> 
>             Hashtable env = new Hashtable();
>             env.put( Context.INITIAL_CONTEXT_FACTORY,
> "org.apache.naming.java.javaURLContextFactory" );
>             env.put( Context.URL_PKG_PREFIXES, "org.apache.naming" );
> 
>             try
>             {
>                 InitialContext ic = new InitialContext( env );
> 
>                 ic.createSubcontext( "java:" );
(Continue reading)

Nathan Maves | 1 Feb 2009 17:06
Picon

Re: SQL-Map / CDATA Performance Issue

Please ensure you turn off all logging while running your tests.

On Sun, Feb 1, 2009 at 6:56 AM, Kai Grabfelder <nospam <at> kaigrabfelder.de> wrote:
Hi,

looks like the pdf in svn is outdated. Please use the open office source instead
(http://svn.apache.org/repos/asf/ibatis/trunk/java/ibatis-2/ibatis-2-docs/en/iBATIS-SqlMaps-2_en.sxw).

I've opened a Jira Issue to address this:

https://issues.apache.org/jira/browse/IBATIS-578

btw: statementCachingEnabled is set to true by default, so if you didn't disable it it should be already on

Regards

Kai


--- Original Nachricht ---
Absender: M. Goodell
Datum: 01.02.2009 01:44
> I downloaded this documentation from the website. I am assuming since it's
> the only Developers Guide available on the website that it was the latest
> version. Am I mistaken? Where can I get the latest version of the docs?
>
> -----Original Message-----
> From: Chema [mailto:demablogia <at> gmail.com]
> Sent: Saturday, January 31, 2009 2:18 PM
> To: user-java <at> ibatis.apache.org
> Subject: Re: SQL-Map / CDATA Performance Issue
>
>
> Yes, yours is old.
>
> Mine is dated on November 30, 2006  (2.3.x )
>
>
>
>
> 2009/1/31 M. Goodell <mgglist <at> comcast.net>:
>> Thanks for your help. I do not see a reference to statementCaching in my
>> version of the docs.
>>
>> See:
>>
> http://svn.apache.org/repos/asf/ibatis/trunk/java/ibatis-2/ibatis-2-docs/en/
>> iBATIS-SqlMaps-2_en.pdf
>>
>> Is there more recent docs available other than the ones I have?
>>
>> -----Original Message-----
>> From: Chema [mailto:demablogia <at> gmail.com]
>> Sent: Saturday, January 31, 2009 1:54 PM
>> To: user-java <at> ibatis.apache.org
>> Subject: Re: SQL-Map / CDATA Performance Issue
>>
>>
>> About docs:
>>
>> statementCachingEnabled (iBATIS versions 2.3.0 and later)
>> With this setting enabled, iBATIS will maintain a local cache of
>> prepared statements. This can lead to significant performance
>> improvements.
>> Example: statementCachingEnabled="true"
>> Default: true (enabled)
>>
>> I asked you this question because:
>>
>> - I can understand that formatted XML could be parsed slower, but in
>> millis terms
>> - I guess that iBatis builds your query as a prepared statement and,
>> if prepared statements cache is working fine, your query should be
>> cached, so
>> - I think that althought you execute it 10.000 times, XML is parsed
>> just one time. But this conclusion is only based on how I think
>> prepared statements caching works. But I can be wrong :-)
>>
>>
>>
>> 2009/1/31 M. Goodell <mgglist <at> comcast.net>:
>>>
>>> Version: ibatis-2.3.4.726
>>>
>>> Not using statement caching as far as I know.
>>>
>>> Could you please provide a brief example of turning on statement caching?
>> I
>>> have read without it there is a performance hit.
>>>
>>> Thanks!
>>>
>>> M. Goodell
>>>
>>> -----Original Message-----
>>> From: Chema [mailto:demablogia <at> gmail.com]
>>> Sent: Saturday, January 31, 2009 1:12 PM
>>> To: user-java <at> ibatis.apache.org
>>> Subject: Re: SQL-Map / CDATA Performance Issue
>>>
>>>
>>> What version are you using ?
>>> Do you have statement caching enabled ?
>>>
>>>
>>> 2009/1/31 M. Goodell <mgglist <at> comcast.net>:
>>>> Looking further into this it seems to have little to do with the CDATA
>> tag
>>>> but the formatting of the SQL statement. The more formatting applied to
>>> the
>>>> SQL statement, the slower the performance.
>>>>
>>>> Format A is much slower than Format A
>>>>
>>>> (Format A)
>>>> INSERT INTO
>>>>        people (
>>>>        last_name,
>>>>        first_name,
>>>>        age
>>>> ) VALUES (
>>>>        #lastName#,
>>>>        #firstName#,
>>>>        #age#);
>>>>
>>>> (Format B)
>>>> INSERT INTO people (last_name,first_name,age) VALUES
>>>> (#lastName#,#firstName#,#age#);
>>>>
>>>> -----Original Message-----
>>>> From: M. Goodell [mailto:mgglist <at> comcast.net]
>>>> Sent: Saturday, January 31, 2009 12:52 PM
>>>> To: Chema; user-java <at> ibatis.apache.org; mgglist <at> comcast.net
>>>> Subject: RE: SQL-Map / CDATA Performance Issue
>>>>
>>>>
>>>> Here is some more information:
>>>>
>>>> 1.) Using (Format A) and inserting 10,000 records this takes roughly
>> 12-15
>>>> seconds.
>>>>
>>>> (Format A)
>>>> <![CDATA[
>>>> INSERT INTO people (
>>>>        last_name,
>>>>        first_name,
>>>>        age
>>>> ) VALUES (
>>>>        #lastName#,
>>>>        #firstName#,
>>>>        #age#
>>>> );
>>>> ]]>
>>>>
>>>> 2.) Using (Format B) and inserting 10,000 records this takes roughly 7-8
>>>> seconds.
>>>>
>>>> (Format B)
>>>> INSERT INTO people (
>>>>        last_name,
>>>>        first_name,
>>>>        age
>>>> ) VALUES (
>>>>        #lastName#,
>>>>        #firstName#,
>>>>        #age#
>>>> );
>>>>
>>>> 3.) Using (Format C) and inserting 10,000 records this takes roughly 3-4
>>>> seconds.
>>>>
>>>> (Format C)
>>>> INSERT INTO people (last_name, first_name, age) VALUES
>>>> (#lastName#,#firstName#,#age#);
>>>>
>>>> Again, thanks for any help.
>>>>
>>>> -----Original Message-----
>>>> From: Chema [mailto:demablogia <at> gmail.com]
>>>> Sent: Saturday, January 31, 2009 12:24 PM
>>>> To: user-java <at> ibatis.apache.org; mgglist <at> comcast.net
>>>> Subject: Re: SQL-Map / CDATA Performance Issue
>>>>
>>>>
>>>> And without CDATA tag ? Same performance ?
>>>> Indeed, I don't know why you use it for that query
>>>>
>>>>
>>>> 2009/1/31 MGG List Subscription <mgglist <at> comcast.net>:
>>>>> When I format the SQL within my insert element like Example 1.0 and
> time
>>>>> several application calls the performance is degraded *substantially*.
>>>>> However, if I format the SQL as shown in Example 1.1 the performance
>>>>> improves dramatically.
>>>>>
>>>>> It seems the larger the SQL statement and the more "pretty" formatting
>>>> that
>>>>> is applied to the embedded SQL statement causes the performance to
>>>> degrade.
>>>>> I have read the manual sections on applying the CDATA XML tag to the
> SQL
>>>> but
>>>>> it seems to not make a difference unlsess the SQL is compacted on to
> one
>>>>> line.
>>>>>
>>>>> Thank you in advance for any help!
>>>>>
>>>>> Example 1.0:
>>>>>
>>>>> <insert id="insertPerson" parameterClass="springibatis.Person">
>>>>>        <![CDATA[
>>>>>        INSERT INTO people (
>>>>>                last_name,
>>>>>                  first_name,
>>>>>                  age
>>>>>                ) VALUES (
>>>>>                  #lastName#,
>>>>>                  #firstName#,
>>>>>                  #age#
>>>>>                );
>>>>>        ]]>
>>>>>    </insert>
>>>>>
>>>>>
>>>>> Example 1.1:
>>>>>
>>>>> <insert id="insertPerson" parameterClass="springibatis.Person">
>>>>>        <![CDATA[
>>>>>        INSERT INTO people (last_name, first_name, age) VALUES
>>> (#lastName#,
>>>>> #firstName#, #age#);
>>>>>        ]]>
>>>>> </insert>
>>>>> No virus found in this outgoing message.
>>>>> Checked by AVG - www.avg.com
>>>>> Version: 8.0.233 / Virus Database: 270.10.16/1926 - Release Date:
>>> 01/30/09
>>>>> 17:31:00
>>>>>
>>>>>
>>>> No virus found in this incoming message.
>>>> Checked by AVG - www.avg.com
>>>> Version: 8.0.233 / Virus Database: 270.10.16/1926 - Release Date:
>> 01/30/09
>>>> 17:31:00
>>>>
>>>> No virus found in this outgoing message.
>>>> Checked by AVG - www.avg.com
>>>> Version: 8.0.233 / Virus Database: 270.10.16/1926 - Release Date:
>> 01/30/09
>>>> 17:31:00
>>>>
>>>> No virus found in this incoming message.
>>>> Checked by AVG - www.avg.com
>>>> Version: 8.0.233 / Virus Database: 270.10.16/1926 - Release Date:
>> 01/30/09
>>>> 17:31:00
>>>>
>>>> No virus found in this outgoing message.
>>>> Checked by AVG - www.avg.com
>>>> Version: 8.0.233 / Virus Database: 270.10.16/1926 - Release Date:
>> 01/30/09
>>>> 17:31:00
>>>>
>>>>
>>> No virus found in this incoming message.
>>> Checked by AVG - www.avg.com
>>> Version: 8.0.233 / Virus Database: 270.10.16/1926 - Release Date:
> 01/30/09
>>> 17:31:00
>>>
>>> No virus found in this outgoing message.
>>> Checked by AVG - www.avg.com
>>> Version: 8.0.233 / Virus Database: 270.10.16/1926 - Release Date:
> 01/30/09
>>> 17:31:00
>>>
>>>
>> No virus found in this incoming message.
>> Checked by AVG - www.avg.com
>> Version: 8.0.233 / Virus Database: 270.10.16/1926 - Release Date: 01/30/09
>> 17:31:00
>>
>> No virus found in this outgoing message.
>> Checked by AVG - www.avg.com
>> Version: 8.0.233 / Virus Database: 270.10.16/1926 - Release Date: 01/30/09
>> 17:31:00
>>
>>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.0.233 / Virus Database: 270.10.16/1926 - Release Date: 01/30/09
> 17:31:00
>
> No virus found in this outgoing message.
> Checked by AVG - www.avg.com
> Version: 8.0.233 / Virus Database: 270.10.16/1926 - Release Date: 01/30/09
> 17:31:00
>
>


javaguy44 | 2 Feb 2009 10:39
Picon
Favicon

ibator - generate all tables for a schema w/out defining <table> element for each table


Hi,

I've been a happy ibatis, abator, ibator user for a little while now, but
there is one feature missing that I think would make my life a lot
easier...and possibly others.  Is there a way to generate all tables for a
schema w/out specifying <table> element in ibator config.xml?

My current workflow when doing DDL changes is as follows:
1.  use GUI datamodeling tool to define / modify columns etc.
2.  actually create schema + tables in DB via script run etc.
3.  modify my ibator config by adding a new <table> element per new table.
4.  generate my classes.

It would be SUPER if we can eliminate step 3.  I can appreciate the need to
override default behavior via <table> elements, but for some of us who don't
need step 3, it seems anti DRY.

Perhaps this functionality is already available and I don't know about it? 
Would love to hear that.

Many thanks
--

-- 
View this message in context: http://www.nabble.com/ibator---generate-all-tables-for-a-schema-w-out-defining-%3Ctable%3E-element-for-each-table-tp21786658p21786658.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.

Betto McRose Gamarra | 2 Feb 2009 15:17
Picon

error on pure sql send to SqlMapSession

query to send
==========
SELECT DISTINCT column_name  
   FROM dba_tab_columns 
 WHERE owner = 'WEBUSER'   
      AND table_name = 'users'

reference.xml
==========
<select id="runSql" parameterClass="java.lang.String" resultClass="java.lang.Object">
         <![CDATA[$sentenciaSql$]]>
</select>

this works in other places I use, for example with this query
SELECT DISTINCT table_name   FROM dba_tables WHERE owner = 'WEBUSER'


and the error trace
=============

[STDERR] com.ibatis.common.jdbc.exception.NestedSQLException:  
--- The error occurred in py/com/sif/dna/sgc/persistence/sqlmap/sql/referencia.xml. 
--- The error occurred while applying a result map. 
--- Check the Ref.runSql-AutoResultMap. 
--- Check the result mapping for the 'TABLE_NAME' property. 
--- Cause: java.sql.SQLException: Nombre de columna no válido
ERROR [STDERR]     at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:201)

what could be the problem ?


--
Betto McRose Gamarra
IcarusDB
"Soluciones Informáticas"
Cel.: +595 992 686947


Larry Meadors | 2 Feb 2009 15:31
Picon
Gravatar

Re: error on pure sql send to SqlMapSession

Add remapResults="true" to your select element.

Larry

Betto McRose Gamarra | 2 Feb 2009 15:38
Picon

Re: error on pure sql send to SqlMapSession

que locoooooo

excellent, it works perfectly

thanks Larry

On Mon, Feb 2, 2009 at 10:31, Larry Meadors <larry.meadors <at> gmail.com> wrote:
Add remapResults="true" to your select element.

Larry



--
Betto McRose Gamarra
IcarusDB
"Soluciones Informáticas"
Cel.: +595 992 686947


Jeff Butler | 2 Feb 2009 15:46
Picon

Re: ibator - generate all tables for a schema w/out defining <table> element for each table

You can do this:

<table schema="MySchema" tableName="%" />

This will pick all tables in the schema.

Jeff Butler

On Mon, Feb 2, 2009 at 3:39 AM, javaguy44 <javaguy44 <at> yahoo.com> wrote:
>
> Hi,
>
> I've been a happy ibatis, abator, ibator user for a little while now, but
> there is one feature missing that I think would make my life a lot
> easier...and possibly others.  Is there a way to generate all tables for a
> schema w/out specifying <table> element in ibator config.xml?
>
> My current workflow when doing DDL changes is as follows:
> 1.  use GUI datamodeling tool to define / modify columns etc.
> 2.  actually create schema + tables in DB via script run etc.
> 3.  modify my ibator config by adding a new <table> element per new table.
> 4.  generate my classes.
>
> It would be SUPER if we can eliminate step 3.  I can appreciate the need to
> override default behavior via <table> elements, but for some of us who don't
> need step 3, it seems anti DRY.
>
> Perhaps this functionality is already available and I don't know about it?
> Would love to hear that.
>
> Many thanks
> --
> View this message in context: http://www.nabble.com/ibator---generate-all-tables-for-a-schema-w-out-defining-%3Ctable%3E-element-for-each-table-tp21786658p21786658.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>


Gmane