-->
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.  [ 4 posts ] 
Author Message
 Post subject: Getting error in clustered environment
PostPosted: Tue Nov 08, 2005 2:44 pm 
Newbie

Joined: Tue Nov 08, 2005 1:25 pm
Posts: 2
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

I am using weblogic 7.0.5 in clustered environment. When i am executing the transaction I am getting the following error. Do in need to do any setting on weblogic side. It works fine in non-clustered environment.


Hibernate version:hibernate 3

Mapping documents/configuration:<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory name="hibernate_SessionFactory">
<property name="connection.datasource">weblogic.jdbc.jts.TestLogPool</property>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>

<property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="transaction.manager_lookup_class">org.hibernate.transaction.WeblogicTransactionManagerLookup</property>

<!--
<property name="query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
-->

<!-- Mapping files -->

<mapping resource="EventHeader.hbm.xml"/>

<mapping resource="EventDetail.hbm.xml"/>
</session-factory>
</hibernate-configuration>


Code between sessionFactory.openSession() and session.close():
try {
Session session = HibernateUtil.currentSession();
Transaction tx = session.beginTransaction();
for(int i=0;i<al.size();i++){
session.save(al.get(i));
}
tx.commit();

}
catch (Exception he){
he.printStackTrace();
throw new RemoteException();
}
finally {
try{
HibernateUtil.closeSession();
}catch (Exception he){
he.printStackTrace();
throw new RemoteException();
}

}
}


Full stack trace of any exception that occurs:<Nov 8, 2005 9:13:58 AM PST> <Error> <Cluster> <000123> <Conflict start: You tried to bind an object under the name hibernate_SessionFactory in the JNDI tree. The object you have bound from 10.121.140.111 is non clusterable and you have tried to bind more than once from two or more servers. Such objects can only deployed from one server.>


Name and version of the database you are using:oracle 9i RAC

The generated SQL (show_sql=true):Hibernate: select EVENT_LOG_HEADER_TBL_SEQ.nextval from dual
Hibernate: select EVENT_LOG_DETAIL_TBL_SEQ.nextval from dual
Hibernate: select EVENT_LOG_DETAIL_TBL_SEQ.nextval from dual
Hibernate: select EVENT_LOG_DETAIL_TBL_SEQ.nextval from dual
Hibernate: select EVENT_LOG_DETAIL_TBL_SEQ.nextval from dual
Hibernate: select EVENT_LOG_DETAIL_TBL_SEQ.nextval from dual
Hibernate: select EVENT_LOG_DETAIL_TBL_SEQ.nextval from dual
Hibernate: select EVENT_LOG_DETAIL_TBL_SEQ.nextval from dual
Hibernate: select EVENT_LOG_DETAIL_TBL_SEQ.nextval from dual
Hibernate: insert into EVENT_LOG_HEADER (EVENT_KEY, SESSION_ID, USER_ID, USER_TYPE_CODE, EVENT_LOG_HEADER_KEY) values (?, ?, ?, ?, ?)
Hibernate: insert into EVENT_LOG_DETAIL (CHARACTARISTIC_NAME, CHARACTARISTIC_VALUE_TEXT, EVENT_LOG_HEADER_KEY, EVENT_LOG_DETAIL_KEY) values (?, ?, ?, ?)
Hibernate: insert into EVENT_LOG_DETAIL (CHARACTARISTIC_NAME, CHARACTARISTIC_VALUE_TEXT, EVENT_LOG_HEADER_KEY, EVENT_LOG_DETAIL_KEY) values (?, ?, ?, ?)
Hibernate: insert into EVENT_LOG_DETAIL (CHARACTARISTIC_NAME, CHARACTARISTIC_VALUE_TEXT, EVENT_LOG_HEADER_KEY, EVENT_LOG_DETAIL_KEY) values (?, ?, ?, ?)
Hibernate: insert into EVENT_LOG_DETAIL (CHARACTARISTIC_NAME, CHARACTARISTIC_VALUE_TEXT, EVENT_LOG_HEADER_KEY, EVENT_LOG_DETAIL_KEY) values (?, ?, ?, ?)
Hibernate: insert into EVENT_LOG_DETAIL (CHARACTARISTIC_NAME, CHARACTARISTIC_VALUE_TEXT, EVENT_LOG_HEADER_KEY, EVENT_LOG_DETAIL_KEY) values (?, ?, ?, ?)
Hibernate: insert into EVENT_LOG_DETAIL (CHARACTARISTIC_NAME, CHARACTARISTIC_VALUE_TEXT, EVENT_LOG_HEADER_KEY, EVENT_LOG_DETAIL_KEY) values (?, ?, ?, ?)
Hibernate: insert into EVENT_LOG_DETAIL (CHARACTARISTIC_NAME, CHARACTARISTIC_VALUE_TEXT, EVENT_LOG_HEADER_KEY, EVENT_LOG_DETAIL_KEY) values (?, ?, ?, ?)
Hibernate: insert into EVENT_LOG_DETAIL (CHARACTARISTIC_NAME, CHARACTARISTIC_VALUE_TEXT, EVENT_LOG_HEADER_KEY, EVENT_LOG_DETAIL_KEY) values (?, ?, ?, ?)


Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject: Got same issue with Clustered Weblogic environment
PostPosted: Fri Jun 09, 2006 3:11 pm 
Newbie

Joined: Fri Jun 09, 2006 3:08 pm
Posts: 1
Please, provide me if you found any solution for this.

Thanks,
CD


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 09, 2006 5:43 pm 
Regular
Regular

Joined: Mon May 22, 2006 2:30 pm
Posts: 74
Why are you trying to register the SessionFactory with the JNDI service?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 10, 2006 12:57 pm 
Senior
Senior

Joined: Tue Mar 09, 2004 2:38 pm
Posts: 141
Location: Lowell, MA USA
The session factory is not a clusterable object. I ran into the same problem and the SessionFactory was only available to the first machine that was brought up in the cluster. We solved the problem by adding this property to our Hibernate config:

Code:
<property name="hibernate.jndi.weblogic.jndi.replicateBindings">false</property>


This will keep weblogic from trying to replicate the SessionFactory in the cluster. Keep in mind that each node in the cluster has it's own SessionFactory instance independent of one another. Generally, this is not a big deal. But if your using a second-level cache, you'll need to make sure your cache is clusterable.

Ryan-

_________________
Ryan J. McDonough
http://damnhandy.com

Please remember to rate!


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