-->
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.  [ 2 posts ] 
Author Message
 Post subject: Problem with sessions (ORA-02391:exceeded simultaneous...)
PostPosted: Tue Dec 11, 2012 3:20 am 
Newbie

Joined: Mon Feb 06, 2012 10:53 am
Posts: 9
Hi,
I have a web application with struts and hibernate 3.6.8 and I'm using c3p0 as datasource for hibernate. I'm having a problem with the connections opened.

My database is oracle and I have an user that can have 10 connections as max, thus in the hibernate.cfg.xml I set 9 as c3p0.max_size but I receive an exception because the max of sessions has been exceded.

As I receive this exception, I decrease the max number of connections in hibernate.cfg.xml. Now, I have 7 connections but yesterday I receive the same exception. I have search in the code I didn't find any place where I can leave opened some conecction, thus I'm very lost. I don't understand this problem and I don't know why happens.

Somebody could help me???, please!

Code:
2012-12-11 11:03:15,887 WARN  com.mchange.v2.resourcepool.BasicResourcePool > com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@ff5df0 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception:
java.sql.SQLException: ORA-02391: s'ha excedit el límit del paràmetre SESSIONS_PER_USER simultànies, màxim

   at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)


This is my hibernate.cfg.xml
Code:
<property name="hibernate.bytecode.use_reflection_optimizer">false</property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<property name="hibernate.connection.autocommit">false</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</property>
<property name="hibernate.connection.password">----</property>
<property name="hibernate.connection.url">----</property>
<property name="hibernate.connection.username">-----</property>
<property name="hibernate.current_session_context_class">thread</property>
<property name="hibernate.default_schema">--------</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
<property name="hibernate.format_sql">true</property>
<property name="hibernate.search.autoregister_listeners">false</property>
<property name="hibernate.show_sql">false</property>

<!-- configuration pool via c3p0-->
<property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
<property name="c3p0.acquire_increment">1</property>
<property name="c3p0.idle_test_period">100</property> <!-- seconds -->
<property name="c3p0.max_size">7</property>
<property name="c3p0.max_statements">0</property>
<property name="c3p0.min_size">1</property>
<property name="c3p0.timeout">100</property> <!-- seconds -->


Thanks in advance.

Regards.
Marcos.


Top
 Profile  
 
 Post subject: Re: Problem with sessions (ORA-02391:exceeded simultaneous...)
PostPosted: Tue Dec 11, 2012 8:47 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
If I remember correctly, c3p0.max_size just adresses the size of non-used (pooled) session without considering active session.
Thus is can happen that you have for example 5 active sessions + 6 pooled sessions , 5 + 6 > 10

Anyway I suggest you to monitor the C3P0 using JMX/JConsole so you can exactly see the number of sessions

http://amemon.wordpress.com/2007/07/15/monitoring-c3p0-using-jmxjconsole/


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