-->
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.  [ 1 post ] 
Author Message
 Post subject: Datasource/connection URL with transactional cache and JTA
PostPosted: Thu Dec 21, 2006 2:38 pm 
Newbie

Joined: Tue Jul 25, 2006 3:54 am
Posts: 2
I'm using hibernate3.2.1 with JBossCache1.3.0.SP4, deployed on WebLogic9.1.
In Java Persistence with Hibernate, it is said that 'In such a managed environment (i.e. JTA transaction service
involved), Hibernate no longer creates and maintains a JDBC connection pool - Hibernate obtains
database connections by looking up a Datasource object in the JNDI registry.
' (JPwH, p. 97)

When I'm following this advice and referencing DataSource from hibernate configuration,
perstistent operations work well. But when I tried to reference just connection URL
from hibernate configuration
, no error appeared, JTATransaction logged that it 'Committed JTA UserTransaction',
but database was not affected by the insert statement at all.
I've found a similar topic at http://forum.hibernate.org/viewtopic.php?t=942801.

Is it true that when integrated with JTA transaction service, hibernate
needs to reference datasource, not connection URL?
Second, what's the exact relationship and interaction between JTA transaction service
and DataSource? Is it the case that JTA transaction service doesn't know
what DataSource to coordinate?

Configuration
=============
A. When using datasource, the hibernate configuration looked like:
Code:
...
<property name="hibernate.connection.datasource">mydatasource</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="connection.username">user</property>
<property name="connection.password">pwd</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WeblogicTransactionManagerLookup</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.TreeCacheProvider</property>
...

the treecache.xml:
Code:
...
<attribute name="TransactionManagerLookupClass">
    org.jboss.cache.GenericTransactionManagerLookup
</attribute>
...

B. When using connection URL, the following two lines replaced the first
line from listing A:
Code:
<property name="connection.url">jdbc:oracle:thin:@//myhost:1521/myservice</property>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>


Thanks a lot,

Veronym


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

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.