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: JBOSS Hibernate Oracle
PostPosted: Wed Jun 22, 2005 4:40 pm 
Newbie

Joined: Tue May 31, 2005 1:54 pm
Posts: 2
Hi,

I'm using JBOSS 3.2.1 and i'm having the following problem:

My application uses CMT, with transaction attribute Required in all the EJB's (stateless session beans) method. Just as information, in the application all users are updated when they log in. The problems occurs when I start the JBOSS in two diferents machines when I log in in one of them I cannot login in the other server because it stops in the session.flush after the update command but if I stop the server that I first log in I can use the second one without problems. The strange thing is that the user that I use to log in in the application is kept locked until I stops the server I can't update it even with sql plus.

Hibernate version: 2.1.8

Mapping documents:

The beginning of the Hibernate.cfg <session-factory
name="java:comp/env/hibernate/SessionFactory">

<!-- properties -->
<property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>
<property name="connection.datasource">java:/OracleDS</property>
<property name="show_sql">true</property>
<property name="use_outer_join">true</property>
<property name="query.substitutions">true 1, false 0</property>
<property name="cglib.use_reflection_optimizer">false</property>
<property name="cache.use_query_cache">false</property>
<property name="transaction.factory_class">net.sf.hibernate.transaction.JTATransactionFactory</property>
<property name="transaction.manager_lookup_class">net.sf.hibernate.transaction.JBossTransactionManagerLookup</property>

Oracle-ds.xml
<datasources>
<local-tx-datasource>
<jndi-name>OracleDS</jndi-name>
<connection-url>jdbc:oracle:thin:@161.24.4.16:1521:SEGDES</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>sa</user-name>
<password></password>
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<min-pool-size>25</min-pool-size>
<max-pool-size>100</max-pool-size>
<blocking-timeout-millis>5000</blocking-timeout-millis>
<idle-timeout-minutes>10</idle-timeout-minutes>
</local-tx-datasource>
</datasources>



Code between sessionFactory.openSession() and session.close():
Session session = ConnectionFactory.getInstance().getSession();

try {

session.update(entidade);
session.flush();

} catch (HibernateException e) {
e.printStackTrace();
} finally {
if (session != null) {
try {
session.close();
} catch (HibernateException e) {
throw new SystemException(e);
}
}
}


SessionFactory

public Session getSession() {
try {
/*
* Use the Hibernate Session Factory to return an open session to the caller.
*/
Session s = sessionFactory.openSession();
return s;
} catch (HibernateException e) {
/*
* Upon encountering a Hibernate generated Exception, we are throwing
* an unchecked RuntimeExcpetion that will cause the user's request to fail.
*
*/
throw new SystemException(e);
}
}



Name and version of the database you are using:Oracle10g

The generated SQL (show_sql=true):
16:32:51,849 INFO [STDOUT] Hibernate: update T_Usuario_MTE set DTHABSENHA=?, EMAIL=?, LOGIN=?, SENHA=?, DDD=?, TELEFONE=?, FLGBLQSENHA=?, NUMTENTATIVAS=? where insAutDig=? and TipUsuario=?


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.