-->
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: How to monitor Hibernate problem? Open cursors/connections
PostPosted: Thu Jul 22, 2010 10:35 am 
Newbie

Joined: Tue Apr 13, 2010 6:14 pm
Posts: 6
Location: El Salvador
Hi to all, i have a big issue with my application. I'm working with Hibernate 3 and JPA with Struts 2 application using Glassfish for debug the application (in Netbeans 6.7). I have a problem because my application sometimes freezes and i don't know why, but when i see in toad looking for open connections or something like that and i see that some queries hangs into the connection, queries that are generated by hibernate from hql query.

I don't understand why happens that, the queries doesn't look complex or something like that, for example this is one of the queries:
Code:
entityMngr.createQuery("FROM WbkParametrosGenerales " +
                " WHERE codParametro ='WBK_WS_SERVER_PATH' and codEmpresa = 1 AND codAplicacion = 'WBK' ");

And in each request, thanks to struts 2 interceptor, when the request goes to server, i initialize an entitymanager and transaction, and when i finished to do all my stuff, i close the entitymanager, os i just can't find what's the problem. On the configuration side, i don's see anything special, take a look:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
  <persistence-unit name="MyPU" transaction-type="RESOURCE_LOCAL">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <non-jta-data-source/>
    <properties>
      <property name="hibernate.connection.username" value="usr"/>
      <property name="hibernate.connection.driver_class" value="oracle.jdbc.OracleDriver"/>
      <property name="hibernate.connection.password" value="pass"/>
      <property name="hibernate.connection.url" value="jdbc:oracle:thin:@192.100.100.100:1521:MYSID"/>
      <property name="hibernate.cache.provider_class" value="org.hibernate.cache.NoCacheProvider"/>
      <property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/>
      <property name="hibernate.c3p0.min_size" value="1" />
      <property name="hibernate.c3p0.max_size" value="60" />
      <property name="hibernate.c3p0.timeout" value="1000" />
    </properties>
  </persistence-unit>
</persistence>

So, first of all i want to ask you if you know a possible cause of my problem, and/or if you know a way to monitor in detail my application operation and find the specific cause of my problem, i don't know, some software tool to monitor that.

Thanks in advance.

_________________
SCJP 6


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.