-->
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.  [ 5 posts ] 
Author Message
 Post subject: More than one MBEAN for Hibernate in Jboss
PostPosted: Tue Apr 12, 2005 11:57 am 
Newbie

Joined: Fri Apr 01, 2005 12:16 pm
Posts: 3
Hi, i´m working with jboss 4.0.1 and i want to kwon how can i do to have two mbean instantiated for hibernate.

I want one of this for an XAOracle connection, and the other one to have an XASqlServer connection.

I´m working with a n-tier architecture, and the transacctions are managed in EJB with JTA.

Thanks...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 12, 2005 3:01 pm 
Newbie

Joined: Sat Apr 24, 2004 6:25 pm
Posts: 14
Location: Rochester, NY
in your hibernate-service.xml you should make the name of your mbean unique and the "SessionFactoryName" should also be unique.

Ben


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 12, 2005 4:31 pm 
Newbie

Joined: Fri Apr 01, 2005 12:16 pm
Posts: 3
Hi... Thanks for ask...
Excuse me, i dont understand you...

this is my jboss-service.xml


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE server>
<!-- Generated file - Do not edit! -->
<server>
<mbean code="net.sf.hibernate.jmx.HibernateService" name="jboss.jca:service=Hibernate1">
<depends>jboss.jca:service=RARDeployer</depends>
<attribute name="MapResources"></attribute>
<attribute name="JndiName">java:/hibernate/HibernateFactoryXA</attribute>
<attribute name="Datasource">java:/XAOracleDS</attribute>
<attribute name="Dialect">net.sf.hibernate.dialect.OracleDialect</attribute>
<attribute name="UseOuterJoin">false</attribute>
<attribute name="ShowSql">true</attribute>
<attribute name="TransactionStrategy">net.sf.hibernate.transaction.JTATransactionFactory</attribute>
</mbean>
</server>

and this is my hibernate-service.xml


<server>
<mbean code="org.jboss.hibernate.jmx.Hibernate"
name="jboss.har:service=Hibernate1">
<attribute name="DatasourceName">java:/XAOracleDS</attribute>
<attribute name="Dialect">net.sf.hibernate.dialect.OracleDialect</attribute>
<attribute name="SessionFactoryName">java:/hibernate/XASessionFactoryCOMEX</attribute>
<attribute name="CacheProviderClass">
net.sf.hibernate.cache.HashtableCacheProvider
</attribute>
<!-- <attribute name="Hbm2ddlAuto">create-drop</attribute> -->
</mbean>
</server>


what thins must i have to add for a correct configuration???

thancks again...!!!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 12, 2005 4:43 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Are you intending that one use the generic (Hibernate-provided) MBean while the other uses the JBoss-specific MBean?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 14, 2005 7:56 am 
Newbie

Joined: Fri Apr 01, 2005 12:16 pm
Posts: 3
Thank you.
This is my final solution. It Works.

<server>
<mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=Hibernate1">
<attribute name="DatasourceName">java:/XAOracleDS</attribute>
<attribute name="Dialect">net.sf.hibernate.dialect.OracleDialect</attribute>
<attribute name="SessionFactoryName">java:/hibernate/XASessionFactoryCOMEX</attribute>
<attribute name="CacheProviderClass">net.sf.hibernate.cache.HashtableCacheProvider</attribute>
</mbean>
<mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=Hibernate2">
<attribute name="DatasourceName">java:/OracleDS</attribute>
<attribute name="Dialect">net.sf.hibernate.dialect.OracleDialect</attribute>
<attribute name="SessionFactoryName">java:/hibernate/SessionFactoryCOMEX</attribute>
<attribute name="CacheProviderClass">net.sf.hibernate.cache.HashtableCacheProvider</attribute>
</mbean>
</server>


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