-->
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: WebLogic 8.1 with Hibernate 2.1b6 and Oracle 9.2
PostPosted: Fri Dec 12, 2003 2:11 pm 
Regular
Regular

Joined: Fri Dec 12, 2003 2:09 pm
Posts: 84
Location: San Francisco, USA
I am having trouble getting WLS 8.1 container-managed transactions to work correctly with Hibernate 2.1 and an Oracle 9.2 database. My application is a simple "test app" bundled with the jBpm workflow engine (http://jbpm.org). Stateful and stateless session beans provide business services, invoking Hibernate to perform persistence operations while relying upon the WLS container to manage transactions.

The default configuration is for Hibernate use a WLS-managed datasource (see below). I initially configured WLS with a datasource and connection pool using the OracleXADataSource driver class. This worked fine except that Hibernate fails when inserting BLOBs larger than 4000 bytes due to a well-known problem with how Oracle's JDBC drivers handle LOBs (http://www.hibernate.org/56.html).

<!-- Hibernate config to use a WLS-managed datasource -->
<property name="transaction.manager_lookup_class">net.sf.hibernate.transaction.WeblogicTransactionManagerLookup</property>
<property name="connection.datasource">JbpmDS</property>
<property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>

In order to implement the Oracle JDBC workaround, I configured Hibernate to directly connect to Oracle (see below) because I could not find any way to unwrap the WLS JDBC wrappers to get at the underlying wrapper objects. WLS 8.1 dynamically creates wrappers for all JDBC objects, but this foils Oracle when invoking Oracle-specific APIs like BLOB.createTemporary() with a WLS-wrapped Connection.

<!-- Hibernate config to directly manage Oracle connections -->
<property name="transaction.manager_lookup_class">net.sf.hibernate.transaction.WeblogicTransactionManagerLookup</property>
<property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>
<property name="connection.driver_class">oracle.jdbc.xa.client.OracleXADataSource</property>
<property name="connection.url">jdbc:oracle:thin:@localhost:1521:NBOYDLAP</property>

However, configuring Hibernate to connect directly to Oracle thwarts WLS container-managed transactions: based on the logs, Hibernate executes many database statements, but they are never committed by the container.

In summary, I need help to:

1. Configure WLS container-managed transactions to work correctly with a Hibernate session factory that directly opens and manages Oracle connections.

-or-

2. Figure out how to *really* unwrap WLS-wrapped JDBC connections and statements so that I can use the Oracle-specific BLOB API.

Thanks in advance for tips or other suggestions!
- nate


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.