|
From: Rod J. <rod...@in...> - 2004-05-12 19:10:27
|
Lidia
You're right. Autocommit is evil in non-trivial apps. However, this is
really a JBoss question. Have you checked their lists/forums/FAQs?
Regards
Rod
----- Original Message -----
From: "Levkovitch, Lidia" <lle...@su...>
To: <spr...@li...>
Sent: Wednesday, May 12, 2004 7:02 PM
Subject: [Springframework-developer] Turning off autocommit in JBoss /
Oracle datasource
> Folks,
>
> I am using a datasource to have my Spring DAOs connect to Oracle database.
> Apparently, with my set up, autocommit is turned on, and this is not what
I
> need!
> I have actually put this line of code inside one of the DAOs'
> afterPropertiesSet() method:
> logger.debug("autocommit is " + getDs().getConnection().getAutoCommit());
> and this prints "autocommit is true".
>
> Is there a way to configure my datasource so that autocommit is set to
> false? I am using JBoss 3.2.1 with Oracle 9.2. In one of JBoss forums it
> actually.
>
> The datasource is defined in myapp-ds.xml file like this:
> (this is based on the example that came with JBoss)
> <datasources>
> <local-tx-datasource>
> <jndi-name>myapp-ds</jndi-name>
>
> <connection-url>jdbc:oracle:thin:@[my database
> name]</connection-url>
> <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
> <user-name>[my user name]</user-name>
> <password>[my password]</password>
> <min-pool-size>3</min-pool-size>
> <max-pool-size>30</max-pool-size>
> <blocking-timeout-millis>3000</blocking-timeout-millis>
> <idle-timeout-minutes>15</idle-timeout-minutes>
>
>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleEx
> ceptionSorter</exception-sorter-class-name>
> </local-tx-datasource>
> </datasources>
>
> All my DAO objects use the dataSource bean which is defined in my
> application context as follows:
> <bean id="dataSource"
class="org.springframework.jndi.JndiObjectFactoryBean"
> singleton="true" lazy-init="default" autowire="default"
> dependency-check="default">
> - <property name="jndiName">
> <value>myapp-ds</value>
> </property>
> - <property name="resourceRef">
> <value>true</value>
> </property>
> </bean>
>
> Thank you very much!
> Lidia
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Sleepycat Software
> Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to
> deliver higher performing products faster, at low TCO.
> http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
|