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.  [ 7 posts ] 
Author Message
 Post subject: Hibernate - DataSource WebSphere AppServer 5
PostPosted: Sat Feb 28, 2004 2:23 pm 
Regular
Regular

Joined: Tue Oct 14, 2003 11:11 pm
Posts: 62
Location: Brasil/Curitiba
Hi, I'm trying to configure the Hibernate to connect in a WebSphere datasource.

hibernate.cfg.xml:
Code:
<property name="connection.datasource">jdbc/crea</property>


jdbc/crea is a valid data source wich connects on Oracle 8.


this error is occuring in the WebSphere log file:

Code:
[2/28/04 16:15:25:750 GMT-03:00] 27da1d44 LocalTransact E WLTC0032E: One or more resources rolled back. An unresolved LocalTransactionContainment had an unresolved action of rollback.
[2/28/04 16:15:25:750 GMT-03:00] 27da1d44 TraceNLS      u No message text associated with key LocalTransaction.rolled-back.due.to.setRollbackOnly in bundle com.ibm.ejs.resources.seriousMessages
[2/28/04 16:15:25:750 GMT-03:00] 27da1d44 WebAppTransac E LocalTransaction rolled-back due to setRollbackOnly
[2/28/04 16:15:25:766 GMT-03:00] 27da1d44 WebGroup      E SRVE0026E: [Servlet Error]-[LocalTransaction rolled-back due to setRollbackOnly]: com.ibm.ws.LocalTransaction.RolledbackException
   at com.ibm.ws.LocalTransaction.LocalTranCoordImpl.cleanup(LocalTranCoordImpl.java:966)
   at com.ibm.ws.webcontainer.webapp.WebAppTransactionCollaborator.postInvoke(WebAppTransactionCollaborator.java:208)
   at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:671)
   at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:176)
   at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
   at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:201)
   at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
   at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:114)
   at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
   at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
   at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
   at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:516)
   at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:366)
   at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)


any idea?

thanks

_________________
Ricardo Lecheta


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 28, 2004 2:56 pm 
Regular
Regular

Joined: Tue Oct 14, 2003 11:11 pm
Posts: 62
Location: Brasil/Curitiba
the application works well, but this error occurs in the log file.

please, my application is in production !

thanks.

_________________
Ricardo Lecheta


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 28, 2004 3:26 pm 
Regular
Regular

Joined: Tue Oct 14, 2003 11:11 pm
Posts: 62
Location: Brasil/Curitiba
Hi,

more one question :-)

How can I disable the pool?

I've put the this line in hibernate.cfg.xml:
Code:
<property name="hibernate.connection.pool_size">0</property>


but this warning is happening;
Code:
DriverManagerConnectionProvider  Hibernate connection pool size: 0
Using Hibernate built-in connection pool (not for production use!)


Code:
[28/02/04 16:22:26:203 GMT-03:00] 46b09be0 SettingsFacto I net.sf.hibernate.cfg.SettingsFactory  Use outer join fetching: true
[28/02/04 16:22:26:219 GMT-03:00] 46b09be0 DriverManager I net.sf.hibernate.connection.DriverManagerConnectionProvider  Using Hibernate built-in connection pool (not for production use!)
[28/02/04 16:22:26:219 GMT-03:00] 46b09be0 DriverManager I net.sf.hibernate.connection.DriverManagerConnectionProvider  Hibernate connection pool size: 0
[28/02/04 16:22:26:219 GMT-03:00] 46b09be0 DriverManager I net.sf.hibernate.connection.DriverManagerConnectionProvider  using driver: oracle.jdbc.OracleDriver at URL: jdbc:oracle:thin:@10.78.1.1:1521:ctba
[28/02/04 16:22:26:219 GMT-03:00] 46b09be0 DriverManager I net.sf.hibernate.connection.DriverManagerConnectionProvider  connection properties: {user=portal, password=portal}


thanks

_________________
Ricardo Lecheta


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 30, 2004 2:39 pm 
Beginner
Beginner

Joined: Tue Mar 02, 2004 6:17 pm
Posts: 20
Hi,

I'm having similar problem with Websphere 5 + Oracle 9. The strange thing is that the transactions are actually committed into the database even though I get the error as below.

The datasource in hibernate.cfg.xml is like this:
Code:
<property name="default_schema">SEATEST</property>
<property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>
<property name="connection.driver_class">oracle.jdbc.xa.client.OracleXADataSource</property>
<property name="show_sql">true</property>


Here is the screen output:
Code:
E WLTC0033E: Resource jdbc/seadatasource rolled back in cleanup of unresolved LocalTransactionContainment.
[3/30/04 13:11:46:944 EST] 56678a62 LocalTransact E WLTC0032E: One or more resources rolled back. An unresolved LocalTransactionContainment had an unresolved action of rollback.
[3/30/04 13:11:47:069 EST] 56678a62 TraceNLS      u No message text associated with key LocalTransaction.rolled-back.due.to.setRollbackOnly in bundle com.ibm.ejs.resources.seriousMessages
[3/30/04 13:11:47:069 EST] 56678a62 WebAppTransac E LocalTransaction rolled-back due to setRollbackOnly
[3/30/04 13:11:47:101 EST] 56678a62 WebGroup      E SRVE0026E: [Servlet Error]-[LocalTransaction rolled-back due to setRollbackOnly]: com.ibm.ws.LocalTransaction.RolledbackException
   at com.ibm.ws.LocalTransaction.LocalTranCoordImpl.cleanup(LocalTranCoordImpl.java:966)
   at com.ibm.ws.webcontainer.webapp.WebAppTransactionCollaborator.postInvoke(WebAppTransactionCollaborator.java:208)
   at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:671)
   at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:176)
   at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
   at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:201)
   at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
   at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
   at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
   at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
   at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:516)
   at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:362)
   at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)


Any idea on why?

Dan


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 30, 2004 10:10 pm 
Regular
Regular

Joined: Tue Oct 14, 2003 11:11 pm
Posts: 62
Location: Brasil/Curitiba
Are you committing/rollback the Transaction correctly?

I was forgetting to commit my transaction and because this I got that error.

_________________
Ricardo Lecheta


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 31, 2004 4:05 pm 
Regular
Regular

Joined: Tue Sep 09, 2003 9:37 pm
Posts: 56
Location: Ogden, Utah, USA
Hi!

We have been experiencing this same nightmare! :)

Are you closing connections in a Filter? Are you getting a new connection in a JSP and not rolling it back, or not committing it?

Websphere seems to have a requirement that resources not cross this "containment boundary". From trial and error, it appears to us that the boundary is between JSP and Servlet, and between Servlet and Filter.

We have come up with several workarounds! Let me know what you did if you solved this problem, or if you want to try some of our 'hacks'

Good luck,
Jenica


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 01, 2004 3:37 pm 
Beginner
Beginner

Joined: Tue Mar 02, 2004 6:17 pm
Posts: 20
Hi,

Thanks to all for the replies. My problem was within the Oracle XA-datasource configuration.

I was using Stateless SessionBeans and a non-XA oracle datasource before without any problem. Then another EJB module (already built) was added as a service provider. Since Websphere doesn't allow more than one non-XA datasources, I had to replace my data source.

There seemed to be a glitch in the WAS Server configuration that prevented my new XA datasource from working. I ended up with removing the server instance and reappling the configurations.

Everything seems find now. Here are things I found easy to be missed:
    1. WASD/WAS 5 doesn't actually support XADataSource for Oracle 8. I had to switch to an Oracle 9 database
    2. If switching from Oracle 8 to 9, remember to modify your hibernate dialect to Oracle9Dialect.
    3. Make sure use the correct XADataSource class name for connection.driver_class.
    4. I found recreating data source references helpful for Session beans.


Here is the hibernate.cfg.xml I used:
Code:
<hibernate-configuration>
  <session-factory>
    <!-- Data Source -->
    <property name="connection.datasource">
        jdbc/seadatasource</property>

    <!-- Database Settings -->
    <property name="default_schema">SEATEST</property>
    <property name="dialect">
        net.sf.hibernate.dialect.Oracle9Dialect</property>
    <property name="connection.driver_class">
        oracle.jdbc.xa.client.OracleXADataSource</property>
    <property name="show_sql">true</property>

    <!-- JDBC Settings -->
    <property name="jdbc.use_streams_for_binary">true</property>
    <property name="max_fetch_depth">2</property>
   
    <property name="cache.provider_class">
        net.sf.hibernate.cache.HashtableCacheProvider</property>

    <!-- Transaction API -->
    <property name="transaction.factory_class">
        net.sf.hibernate.transaction.JTATransactionFactory</property>
    <property name="transaction.manager_lookup_class">
        net.sf.hibernate.transaction.WebSphereTransactionManagerLookup
    </property>

    <!-- Mapping files -->
    <mapping resource="hb_TransLog.hbm.xml" />
    <mapping resource="hb_State.hbm.xml" />
    <mapping resource="hb_StateProfile.hbm.xml" />
  </session-factory>
</hibernate-configuration>


Websphere isn't fun. But seems work well with Hibernate anyway ;-)

Dan


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 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.