Re: How to set Prefetch size on the resultSet level in IBATIS

2009-07-05 Thread Jeff Butler
It's already there.  iBATIS is setting the fetch size properly.  The issue
is that his JDBC driver is not honoring the fetch size on the result set.
 We don't have anything in iBATIS that allows changing result set attributes
after they are generated by the driver.
It might not be so bad to add this call after the result set is generated -
don't know if there are any other implications?

Jeff Butler


On Sat, Jul 4, 2009 at 11:27 PM, Ron Grabowski rongrabow...@yahoo.comwrote:

 Would it be so bad to just add a fetchSize attribute to statement /? In
 .NET land I added a preserveWhitespace attribute to statement / to make it
 easier to copy and paste the executing sql into another program and handle
 -- style comments better. I've gotten requests from my team at work to also
 add a commandTimeout property to statement /. That's probably going to
 happen too.

 Perhaps Raga should be encouraged to write a patch, submit it to JIRA, then
 if no one has major objections it can be added instead of encouraging him to
 make an internal fork.

 --
 *From:* Jeff Butler jeffgbut...@gmail.com
 *To:* dev@ibatis.apache.org
 *Sent:* Friday, July 3, 2009 10:40:05 AM

 *Subject:* Re: How to set Prefetch size on the resultSet level in IBATIS

 If you feel you need this, then you could easily hack iBATIS to set the
 fetch size on a result set.  Add these lines to the beginning of the
 handleResults method in
 com.ibatis.sqlmap.engine.execution.DefaultSqlExecuter:
 Integer fetchSize = statementScope.getStatement().getFetchSize();
 if (fetchSize != null) {
   rs.setFetchSize(fetchSize.intValue());
 }

 Before you ask, I'll state that we will probably not add this to the
 official iBATIS2 code base.  But this is the true beauty of open source -
 you can modify the code to make it work the way you need it to work!

 Jeff Butler



 On Fri, Jul 3, 2009 at 9:20 AM, Raghavendran Chellappa 
 raghavendr...@virtusa.com wrote:

  Jeff,

 Many thanks for your reply.



 We are using iBATIS 2.3.0.



 fetchSize set on StoredProcedure gets set on the CallableStatement. But
 unfortunately does not get percolate to the ResultSet when the application
 is running on Weblogic server.

 A point to note is that we are running our application in the same JVM as
 the weblogic server.



 Thanks,

 Raga







 Raghavendran Chellappa, ' Tel: +91 44 42002700 Ext: 3257 Mobile:
 +91-98407 87523
   --

 *From:* Jeff Butler [mailto:jeffgbut...@gmail.com]
 *Sent:* Friday, July 03, 2009 7:38 PM
 *To:* dev@ibatis.apache.org
 *Subject:* Re: How to set Prefetch size on the resultSet level in IBATIS



 What version of iBATIS are you using?  With versions 2.2.0 and later,
 iBATIS will set the fetchSize on stored procedure calls - and that should
 translate to the result set (according to the JDBC spec).



 iBATIS does not support setting the fetchSize directly on a result set.



 Jeff Butler



 On Thu, Jul 2, 2009 at 11:28 PM, Raghavendran Chellappa 
 raghavendr...@virtusa.com wrote:

 Hi,

 We are having issues with the prefetchSize property that is available at
 the procedure element (of ibatis sqlmap). Even though we set the prefetch
 size to a value, say 100, ibatis ignores this and always defaults to 10
 (jdbc driver default). Also our application is a weblogic based J2EE app
 running in the same JVM as the weblogic server. Hence the prefetchSize set
 on the callableStatement will not work.
 But prefetchSize set on the resultSet level will work perfectly(after
 getting the resultSet from the callableStatementt).

 Hence, in IBatis we need to set the prefetchSize at the resultSet level
 while executing a storedproc.
 We dont seem to find a way to do this in ibatis at the moment.

 Is this a limitation/bug or is there a way around this?

 Any help here will be much appreciated.

 thanks,
 Raga





 -



 This message, including any attachments, contains confidential information 
 intended for a specific individual and purpose, and is intended for the 
 addressee only. Any unauthorized disclosure, use, dissemination, copying, or 
 distribution of this message or any of its attachments or the information 
 contained in this e-mail, or the taking of any action based on it, is 
 strictly prohibited. If you are not the intended recipient, please notify 
 the sender immediately by return e-mail and delete this message.



 -



 -

 This message, including any attachments, contains confidential information 
 intended for a specific individual and purpose, and is intended for the 
 addressee only. Any unauthorized disclosure, use, dissemination, copying, or 
 distribution of this message or any of its 

SqlMapClient and knowing when a transaction already started

2009-07-05 Thread Yuri de Wit
If I having a reference to a SqlMapClient how do I know whether a
transaction has already been started for the current thread?
I want to implement a simple transaction interceptor that gets injected with
a SqlMapClient using Guice and start a transaction if not yet started.

thanks in advance!