These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: 'SQLOLEDB' was unable to begin a distributed transaction
PostPosted: Thu Dec 28, 2006 10:33 am 
Newbie

Joined: Thu Dec 28, 2006 10:17 am
Posts: 1
I am refering to two tables both in different databases in my stored procedure. hibernate.connection.url is pointing to the database which has the stored procedure. When I execute the sp directly in the database it is executing without any error, but when I execute it through my application it throws following error
19:37:13,109 WARN [JDBCExceptionReporter] SQL Error: 7391, SQLState: S1000
19:37:13,109 ERROR [JDBCExceptionReporter] The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transac
tion.
19:37:13,689 ERROR [STDERR] Hibernate Exceptioncould not execute native bulk manipulation query
19:37:13,689 ERROR [STDERR] org.hibernate.exception.GenericJDBCException: could not execute native bulk manipulation query
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.engine.query.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:174)
at org.hibernate.impl.SessionImpl.executeNativeUpdate(SessionImpl.java:1163)
at org.hibernate.impl.SQLQueryImpl.executeUpdate(SQLQueryImpl.java:302)
at com.ge.lease.dao.services.TransactionListingService.rDRLoad(TransactionListingService.java:379)
at com.ge.lease.ajax.dwr.ltb.TransactionListingDWR.rDRLoad(TransactionListingDWR.java:72)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at uk.ltd.getahead.dwr.impl.ExecuteQuery.execute(ExecuteQuery.java:239)
at uk.ltd.getahead.dwr.impl.DefaultExecProcessor.handle(DefaultExecProcessor.java:48)

My application is in Spring framework, hibernate and JBoss-4.0.5.GA AS.

following is the entry in hibernate-configuration

<property name="hibernate.connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>
<property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
<property name="hibernate.connection.username">--</property>
<property name="hibernate.connection.password">--</property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
<property name="hibernate.cache.provider_configuration_file_resource_path">ehcache.xml</property>
<property name="hibernate.jdbc.batch_size">40</property>
<property name="hibernate.cache.use_second_level_cache">false</property>
<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.max_size">100</property>
<property name="hibernate.c3p0.timeout">20000</property>
<property name="hibernate.c3p0.max_statements">0</property>
<property name="hibernate.c3p0.acquire_increment">5</property>
<property name="hibernate.cglib.use_reflection_optimizer">true</property>
<property name="show_sql">false</property>
<property name="myeclipse.connection.profile">--</property>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 28, 2006 10:56 am 
Regular
Regular

Joined: Wed Mar 23, 2005 8:43 am
Posts: 105
Location: Moscow, Russia
As i understand, your choose incorrect driver class, wich doesn't support distributed XA-transactions. (You need distributed transaction to work with different resources, in your case, two different databases). By the way, why you trying to use plain JDBC driver and connection, if you have full-functional application server? You must use JTA and DataSource on app server, wich has transaction manager used to manage distributed transactions. Look what JDTS JDBC Driver Documentation (http://jtds.sourceforge.net/faq.html#driverImplementation) says:
Quote:
interface: javax.sql.XADataSource
JDTS driver implementation: net.sourceforge.jtds.jdbcx.JtdsDataSource

_________________
Best Regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.