Post
Install : Oracle 9i - Jboss 4.0.2 - Hibernate 3.0.5 - JDK1.5
we have got many application in production. These are packaged as wars. Here is
our configuration.
OracleDS:
<local-tx-datasource>
<jndi-name>OracleDS</jndi-name>
<connection-url>jdbc:oracle:thin:@xxx:1521:xxx</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>xxx</user-name>
xxx
<min-pool-size>0</min-pool-size>
<max-pool-size>30</max-pool-size>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<type-mapping>Oracle9i</type-mapping>
</local-tx-datasource>
hibernate.cfg.xml:
<hibernate-configuration>
<session-factory>
<!-- datasource connection properties -->
java:/OracleDS
<!-- dialect for Oracle 9 -->
org.hibernate.dialect.Oracle9Dialect
false
org.hibernate.transaction.JBossTransactionManagerLookup
</session-factory>
</hibernate-configuration>
Fecth the session factory:
private Session newSession() {
synchronized (configuration) {
if (sessionFactory == null) {
if (logger.isInfoEnabled()) {
logger.info("HiberConf - initialize sessionFactory");
}
sessionFactory = configuration.buildSessionFactory();
}
return sessionFactory.openSession();
}
}
And DefaultDatasource is set to OracleDS in the standardjbosscmp.xml.
No Hibernate Mbean added in JBoss...
Here is an example of request :
public List getAgentsParResponsableProjet(Integer idResponsable) {
List agents = null;
Transaction tx = null;
synchronized (this) {
try {
session = HibernateUtil.currentSession();
tx = session.beginTransaction();
agents = session.createQuery(
"from ActiviteAffectee aa where aa.Idresponsable='" +
idResponsable.toString() + "'")
.list();
tx.commit();
} catch (Exception ex) {
if (tx != null) {
tx.rollback();
}
if (log.isErrorEnabled()) {
log.error("getAgentsParResponsableProjet", ex);
}
} finally {
HibernateUtil.closeSession();
}
}
return agents;
}
We are just wondering if we have got the right configuration for the couple
JBoss-Hibernate.
Because we have got stranges errors like synchronisation of TransactionManager
the are happening sometimes.
We really need help cause these apps are in production and we couldn't make a
test period for these apps...
Thanks in advance
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3917342#3917342
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3917342
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user