iBATIS always starts a transaction. If you want to avoid transactions completely, you will need to implement your own version of a transaction manager - you can base it on the EXTERNAL transaction manager.
Jeff Butler On Wed, Apr 14, 2010 at 11:43 AM, Ejaz X Mohammed <ejaz.moham...@jpmorgan.com> wrote: > I changed the code to use plain jdbc instead of ibatis ... as I said I'm > doing just SELECT ... I started no tranasaction .. now I don't see any locks, > perf seems to be better too ... > > If we start a transaction, sybase takes locks ... read lock for SELECT ... > > Can we avoid starting TX during select in ibatis? > > Ejaz > > > -----Original Message----- > From: Jeff Butler [mailto:jeffgbut...@gmail.com] > Sent: Wednesday, April 14, 2010 11:36 AM > To: user-java@ibatis.apache.org > Subject: Re: Locks > > I assume you're using SIMPLE datasource. With that data source, the > isolation level is set as a driver default. I just did a quick test > with HSQLDB and the default seems to be TRANSACTION_READ_COMMITTED - a > middle of the road isolation level. Maybe there is some setting on > the Sybase driver that will allow you to change the default isolation > level? > > Alternatively, you can do it in code like this: > > try { > sqlMapClient.startTransaction(Connection.TRANSACTION_READ_UNCOMMITTED); > > -- do some work > } finally { > sqlMapClient.endTransaction(); > } > > If you are using some other datasource (like JNDI), then you'll need > to look to that datasource for information about changing the > isolation level. > > Jeff Butler > > > > > > On Wed, Apr 14, 2010 at 9:51 AM, Ejaz X Mohammed > <ejaz.moham...@jpmorgan.com> wrote: >> These are my settings ... >> >> <!-- >> These settings control SqlMap configuration details, primarily to do with >> transaction >> management. They are all optional (see the Developer Guide for more). >> --> >> <settings >> cacheModelsEnabled="true" >> enhancementEnabled="true" >> lazyLoadingEnabled="true" >> maxRequests="32" >> maxSessions="10" >> maxTransactions="5" >> useStatementNamespaces="true" >> /> >> >> <!-- >> Configure a datasource to use with this SQL Map using SimpleDataSource. >> Notice the use of the properties from the above resource >> --> >> <transactionManager type="JDBC" > >> <dataSource type="...."> >> <property name="JDBC.Driver" value="${jdbc.driver}"/> >> <property name="JDBC.ConnectionURL" value="${jdbc.url}"/> >> <property name="JDBC.Username" value="${jdbc.user}"/> >> <property name="JDBC.Password" value="${jdbc.password}"/> >> <property name="JDBC.DefaultAutoCommit" value="true"/> >> </dataSource> >> </transactionManager> >> >> >> >> >> -----Original Message----- >> From: Jeff Butler [mailto:jeffgbut...@gmail.com] >> Sent: Wednesday, April 14, 2010 9:44 AM >> To: user-java@ibatis.apache.org >> Subject: Re: Locks >> >> It's dependent on the transaction isolation level set on your >> connection. There are many variables involved - what is your >> environment (POOLED, UNPOOLED, JNDI, etc.)? >> >> Jeff Butler >> >> >> On Wed, Apr 14, 2010 at 9:38 AM, Ejaz X Mohammed >> <ejaz.moham...@jpmorgan.com> wrote: >>> Hello, >>> >>> >>> >>> I have an application running on Sybase. DBAs tell me that it is generating >>> too many locks ... I know that all I'm doing is SELECT. >>> >>> >>> >>> I'm not sure how SELECT can create locks in database. >>> >>> >>> >>> Any suggestions ? >>> >>> >>> >>> Thanks >>> >>> Ejaz >>> >>> This email is confidential and subject to important disclaimers and >>> conditions including on offers for the purchase or sale of securities, >>> accuracy and completeness of information, viruses, confidentiality, legal >>> privilege, and legal entity disclaimers, available at >>> http://www.jpmorgan.com/pages/disclosures/email. >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org >> For additional commands, e-mail: user-java-h...@ibatis.apache.org >> <p><span STYLE="color :#000000;background-color :#FFFFFF"> >> This email is confidential and subject to important disclaimers and >> conditions including on offers for the purchase or sale of securities, >> accuracy and completeness of information, viruses, confidentiality, legal >> privilege, and legal entity disclaimers, available at >> http://www.jpmorgan.com/pages/disclosures/email. >> </span></p> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org >> For additional commands, e-mail: user-java-h...@ibatis.apache.org >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org > For additional commands, e-mail: user-java-h...@ibatis.apache.org > > This email is confidential and subject to important disclaimers and > conditions including on offers for the purchase or sale of > securities, accuracy and completeness of information, viruses, > confidentiality, legal privilege, and legal entity disclaimers, > available at http://www.jpmorgan.com/pages/disclosures/email. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org > For additional commands, e-mail: user-java-h...@ibatis.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org