Shifting iBATIS 1.0 to iBATIS 2.2

2007-02-09 Thread Tushar Kherde

Hi All,

Currently I am using iBATIS 1.0 in my system and i want to upgrade it to
iBATIS 2.2.
Can anybody tell me where i will get the change log between these two
versions.
And what will be the impact of this change.

--
With regards
Tushar Kherde


fetchSize

2007-02-13 Thread Tushar Kherde

Hi All,

I want to use fetchsize in my select query.
Can I get sample for this.

--
With regards
Tushar Kherde


Re: fetchSize

2007-02-13 Thread Tushar Kherde

I tried it with oracle 8i and driver jdbc14.jar but not working :(
I just added the fetchSize="5" attribute in select element. Is there
anything else i need to do please correct if i am wrong.
I am using iBATIS2.0 ( Note: i was using iBATIS1.0 and upgraded just by
changing jars )
If possible I need generic solution for this because my system is dealing
with different databases.
Thanks in advance.

On 2/13/07, Brandon Goodin <[EMAIL PROTECTED]> wrote:


Sorry for the bad info. Learn something new all the time. :-/

Brandon

On 2/13/07, Clinton Begin <[EMAIL PROTECTED] > wrote:
>
> Actually it does!
>
> 
>
> Remember that it's just a hint though...not a guarantee IIRC.
>
> Clinton
>
> On 2/13/07, Brandon Goodin <[EMAIL PROTECTED]> wrote:
> > iBATIS does not provide a means to use the setFetchSize on a
> > PreparedStatement. If you are looking to limit the number of rows you
> get
> > back from the database then I suggest using queryForList(id,
> parmObject,
> > skip, max) or placing it in your SQL statement like "select * from foo
> where
> > rownum<10" in Oracle.
> >
> > Brandon
> >
> >
> > On 2/13/07, Tushar Kherde <[EMAIL PROTECTED]> wrote:
> > > Hi All,
> > >
> > > I want to use fetchsize in my select query.
> > > Can I get sample for this.
> > >
> > > --
> > > With regards
> > > Tushar Kherde
> >
> >
>





--
With regards
Tushar Kherde


Re: fetchSize

2007-02-13 Thread Tushar Kherde

Sorry i am using ojdbc14.jar not jdbc14.jar which is for 10g i think its
recent release.

On 2/13/07, Clinton Begin <[EMAIL PROTECTED]> wrote:


You're using an 8 year old database and a 5 year old driver.  :-)

The combination may not support fetch size properly.

Furthermore, even if it is supported by the driver, it is not
guaranteed to fetch exactly that number of rows.  The following is an
excerpt from the JDK JavaDoc for PreparedStatement.setFetchSize()

---
Gives the JDBC driver a hint as to the number of rows that should be
fetched from the database when more rows are needed. The number of
rows specified affects only result sets created using this statement.
If the value specified is zero, then the hint is ignored. The default
value is zero.
---

Clinton

On 2/13/07, Tushar Kherde <[EMAIL PROTECTED]> wrote:
> I tried it with oracle 8i and driver jdbc14.jar but not working :(
> I just added the fetchSize="5" attribute in select element. Is there
> anything else i need to do please correct if i am wrong.
> I am using iBATIS2.0 ( Note: i was using iBATIS1.0 and upgraded just by
> changing jars )
> If possible I need generic solution for this because my system is
dealing
> with different databases.
> Thanks in advance.
>
>  On 2/13/07, Brandon Goodin <[EMAIL PROTECTED]> wrote:
> > Sorry for the bad info. Learn something new all the time. :-/
> >
> > Brandon
> >
> >
> >
> > On 2/13/07, Clinton Begin <[EMAIL PROTECTED] > wrote:
> > > Actually it does!
> > >
> > > 
> > >
> > > Remember that it's just a hint though...not a guarantee IIRC.
> > >
> > > Clinton
> > >
> > > On 2/13/07, Brandon Goodin < [EMAIL PROTECTED]> wrote:
> > > > iBATIS does not provide a means to use the setFetchSize on a
> > > > PreparedStatement. If you are looking to limit the number of rows
you
> get
> > > > back from the database then I suggest using queryForList(id,
> parmObject,
> > > > skip, max) or placing it in your SQL statement like "select * from
foo
> where
> > > > rownum<10" in Oracle.
> > > >
> > > > Brandon
> > > >
> > > >
> > > > On 2/13/07, Tushar Kherde < [EMAIL PROTECTED]> wrote:
> > > > > Hi All,
> > > > >
> > > > > I want to use fetchsize in my select query.
> > > > > Can I get sample for this.
> > > > >
> > > > > --
> > > > > With regards
> > > > > Tushar Kherde
> > > >
> > > >
> > >
> >
> >
>
>
>
> --
> With regards
> Tushar Kherde





--
With regards
Tushar Kherde


Re: fetchSize

2007-02-13 Thread Tushar Kherde

I have mentioned the fetchSize in select  element

Following is the code





   
   select COUNTRY_CODE, COUNTRY_NAME, COUNTRY_SHORT_NAME, RECORD_STATUS,
RECORD_ADDBY,
 RECORD_ADDDATE, RECORD_EDITBY, RECORD_EDITDATE, RECORD_APPROVEBY,
RECORD_APPROVEDATE,
 RECORD_DELETEBY, RECORD_DELETEDATE
   from ICE_COUNTRY
   
 
 
   order by $ABATOR_ORDER_BY_CLAUSE$
 
   
 

which is calling from DAOImpl  using queryforlist  which list i am
displaying on index page. But it fetching all records.


On 2/13/07, Clinton Begin <[EMAIL PROTECTED]> wrote:


Regardless, all of the other points still apply.  :-)

How are you testing to see if it works?

Clinton

On 2/13/07, Tushar Kherde <[EMAIL PROTECTED]> wrote:
> Sorry i am using ojdbc14.jar not jdbc14.jar which is for 10g i think its
> recent release.
>
>
> On 2/13/07, Clinton Begin <[EMAIL PROTECTED]> wrote:
> > You're using an 8 year old database and a 5 year old driver.  :-)
> >
> > The combination may not support fetch size properly.
> >
> > Furthermore, even if it is supported by the driver, it is not
> > guaranteed to fetch exactly that number of rows.  The following is an
> > excerpt from the JDK JavaDoc for PreparedStatement.setFetchSize()
> >
> > ---
> > Gives the JDBC driver a hint as to the number of rows that should be
> > fetched from the database when more rows are needed. The number of
> > rows specified affects only result sets created using this statement.
> > If the value specified is zero, then the hint is ignored. The default
> > value is zero.
> > ---
> >
> > Clinton
> >
> > On 2/13/07, Tushar Kherde < [EMAIL PROTECTED]> wrote:
> > > I tried it with oracle 8i and driver jdbc14.jar but not working :(
> > > I just added the fetchSize="5" attribute in select element. Is there
> > > anything else i need to do please correct if i am wrong.
> > > I am using iBATIS2.0 ( Note: i was using iBATIS1.0 and upgraded just
by
> > > changing jars )
> > > If possible I need generic solution for this because my system is
> dealing
> > > with different databases.
> > > Thanks in advance.
> > >
> > >  On 2/13/07, Brandon Goodin <[EMAIL PROTECTED]> wrote:
> > > > Sorry for the bad info. Learn something new all the time. :-/
> > > >
> > > > Brandon
> > > >
> > > >
> > > >
> > > > On 2/13/07, Clinton Begin <[EMAIL PROTECTED] > wrote:
> > > > > Actually it does!
> > > > >
> > > > > 
> > > > >
> > > > > Remember that it's just a hint though...not a guarantee IIRC.
> > > > >
> > > > > Clinton
> > > > >
> > > > > On 2/13/07, Brandon Goodin < [EMAIL PROTECTED]> wrote:
> > > > > > iBATIS does not provide a means to use the setFetchSize on a
> > > > > > PreparedStatement. If you are looking to limit the number of
rows
> you
> > > get
> > > > > > back from the database then I suggest using queryForList(id,
> > > parmObject,
> > > > > > skip, max) or placing it in your SQL statement like "select *
from
> foo
> > > where
> > > > > > rownum<10" in Oracle.
> > > > > >
> > > > > > Brandon
> > > > > >
> > > > > >
> > > > > > On 2/13/07, Tushar Kherde < [EMAIL PROTECTED]> wrote:
> > > > > > > Hi All,
> > > > > > >
> > > > > > > I want to use fetchsize in my select query.
> > > > > > > Can I get sample for this.
> > > > > > >
> > > > > > > --
> > > > > > > With regards
> > > > > > > Tushar Kherde
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > >
> > > --
> > > With regards
> > > Tushar Kherde
> >
>
>
>
> --
> With regards
> Tushar Kherde





--
With regards
Tushar Kherde


Re: fetchSize

2007-02-13 Thread Tushar Kherde

A big confusion from my side sorry :/

On 2/13/07, Clinton Begin <[EMAIL PROTECTED]> wrote:


Hahait was mass confusion all around. :-)

Clinton

On 2/13/07, Brandon Goodin <[EMAIL PROTECTED]> wrote:
> I would just like to note that I anticipated that was what he wanted and
> stated it upfront. Just cuz i was wrong on one point doesn't mean i was
> wrong on every point :)
>
>
> Brandon
>
>  On 2/13/07, Clinton Begin <[EMAIL PROTECTED]> wrote:
> > Oh.
> >
> > You don't want fetch size.  :-)  Fetch size doesn't have anything to
> > do with the total returned records.  It has to do with how many
> > records it returns at a time.
> >
> > What you want is:
> >
> > sqlMapClient.queryForList ("findAllWhatevers", paramObj, skipThisMany,
> > getThisMany);
> >
> > Page 57 - 61 of the developer guide.
> >
> > Cheers,
> > Clinton
> >
> > On 2/13/07, Tushar Kherde <[EMAIL PROTECTED] > wrote:
> > > I have mentioned the fetchSize in select  element
> > >
> > > Following is the code
> > >
> > >
> > >  > > id="ICE_COUNTRY.abatorgenerated_selectForIndex"
> > > resultMap="abatorgenerated_IceCountryResult"
> > > parameterClass=" java.util.Map" >
> > > 
> > > select COUNTRY_CODE, COUNTRY_NAME, COUNTRY_SHORT_NAME,
> RECORD_STATUS,
> > > RECORD_ADDBY,
> > >   RECORD_ADDDATE, RECORD_EDITBY, RECORD_EDITDATE,
RECORD_APPROVEBY,
> > > RECORD_APPROVEDATE,
> > >   RECORD_DELETEBY, RECORD_DELETEDATE
> > > from ICE_COUNTRY
> > > 
> > >> >
> refid="ICE_COUNTRY.abatorgenerated_Example_Where_Clause" />
> > >> > property="ABATOR_ORDER_BY_CLAUSE" >
> > > order by $ABATOR_ORDER_BY_CLAUSE$
> > >   
> > > 
> > >   
> > >
> > > which is calling from DAOImpl  using queryforlist  which list i am
> > > displaying on index page. But it fetching all records.
> > >
> > >
> > >
> > > On 2/13/07, Clinton Begin < [EMAIL PROTECTED]> wrote:
> > > > Regardless, all of the other points still apply.  :-)
> > > >
> > > > How are you testing to see if it works?
> > > >
> > > > Clinton
> > > >
> > > > On 2/13/07, Tushar Kherde <[EMAIL PROTECTED] > wrote:
> > > > > Sorry i am using ojdbc14.jar not jdbc14.jar which is for 10g i
think
> its
> > > > > recent release.
> > > > >
> > > > >
> > > > > On 2/13/07, Clinton Begin <[EMAIL PROTECTED] > wrote:
> > > > > > You're using an 8 year old database and a 5 year old
driver.  :-)
> > > > > >
> > > > > > The combination may not support fetch size properly.
> > > > > >
> > > > > > Furthermore, even if it is supported by the driver, it is not
> > > > > > guaranteed to fetch exactly that number of rows.  The
following is
> an
> > > > > > excerpt from the JDK JavaDoc for
PreparedStatement.setFetchSize()
> > > > > >
> > > > > > ---
> > > > > > Gives the JDBC driver a hint as to the number of rows that
should
> be
> > > > > > fetched from the database when more rows are needed. The
number of
> > > > > > rows specified affects only result sets created using this
> statement.
> > > > > > If the value specified is zero, then the hint is ignored. The
> default
> > > > > > value is zero.
> > > > > > ---
> > > > > >
> > > > > > Clinton
> > > > > >
> > > > > > On 2/13/07, Tushar Kherde < [EMAIL PROTECTED]> wrote:
> > > > > > > I tried it with oracle 8i and driver jdbc14.jar but not
working
> :(
> > > > > > > I just added the fetchSize="5" attribute in select element.
Is
> there
> > > > > > > anything else i need to do please correct if i am wrong.
> > > > > > > I am using iBATIS2.0 ( Note: i was using iBATIS1.0 and
upgraded
> just
> > > by
> > > > > > > changing jars )
> > > > > > > If possible I need generic solution for this because my
system
> is
> > > > > dealing
> > > > > > > with different databases.
> > 

JNDI Connection

2007-03-14 Thread Tushar Kherde

Hi All,

I am using JNDI, i think iBATIS internally handling all connection pooling
stuff.
I have small doubt, Is iBATIS closing connection? or do I need to close
connection explicitly?.
Because I am getting connection pool exhaust error.

JNDI Error

[Mar 12 13:23:01] ERROR (GenericModuleSecurity.java:169) - JNDI Exception
Cannot get a connection, pool exhausted
[Mar 12 13:23:01] INFO  (GenericModuleSecurity.java:82) -
GenericModuleSecurity
[Mar 12 13:23:01] INFO  (IceAppsGenericPortlet.java:118) -
IceAppsGenericPortlet userId null
[Mar 12 13:23:01] INFO  (GenericModuleSecurity.java:96) - JNDI_RESOURCE_NAME
= jdbc/app_cims
[Mar 12 13:23:11] ERROR (GenericModuleSecurity.java:169) - JNDI Exception
Cannot get a connection, pool exhausted
[Mar 12 13:23:37] INFO  (ApplicationContext.java:646) - Shutting down Log4J


Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a
connection, pool exhausted
   at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(
PoolingDataSource.java:103)
   at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(
BasicDataSource.java:540)
   at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.init(
JdbcTransaction.java:48)
   at
com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.getConnection(
JdbcTransaction.java:89)
   at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList
(GeneralStatement.java:123)
   at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList
(SqlMapExecutorDelegate.java:610)
   at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList
(SqlMapExecutorDelegate.java:584)
   at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(
SqlMapSessionImpl.java:101)
   at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(
SqlMapClientImpl.java:78)
   at com.ibatis.dao.client.template.SqlMapDaoTemplate.queryForList(
SqlMapDaoTemplate.java:203)
   ... 197 more



Thanks in Advance



--
With regards
Tushar Kherde