-->
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: Server configuration denies access to datasource
PostPosted: Tue Aug 17, 2004 7:19 am 
Newbie

Joined: Wed Jun 16, 2004 7:28 am
Posts: 1
Hibernate version:
hibernate 2.1

Mapping documents:
sample document follows here
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>
<class name="com.quadone.hms.general.businessobjects.AddressBO" table="gen_address">
<id name="addressid" column="address_id" type="long">
<generator class="increment"/>
</id>
<property name="hno" column="hno" type="string"/>
<property name="location" column="location" type="string"/>
<property name="street" column="street" type="string"/>
<property name="city" column="city" type="string" not-null="true"/>
<property name="state" column="state" type="string"/>
<property name="pin" column="pincode" type="string"/>
<property name="telephone" column="telephone" type="string"/>
<property name="fax" column="fax" type="string"/>
<property name="type" column="type" type="string"/>
<property name="isActive" column="is_active" type="boolean"/>
</class>
</hibernate-mapping>


Code between sessionFactory.openSession() and session.close():

Session session=null;
List list=null;
try
{
session=sessionFactory.openSession();
list=session.find("from PersonBO where fname like '"+name+"'");
if(list.size()!=0)
{
return list;
}
else
{
throw new NoRecordException("Person doesn't etxist");
}
}
catch(HibernateException e)
{
e.printStackTrace();
return null;
}
finally
{
try {
session.close();
} catch (HibernateException e) {
e.printStackTrace();
}
}


Full stack trace of any exception that occurs:

java.sql.SQLException: Server configuration denies access to data source
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:537)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1585)
at com.mysql.jdbc.Connection.<init>(Connection.java:524)
at com.mysql.jdbc.Driver.connect(Driver.java:359)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at net.sf.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:10
1)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1132)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:766)
at com.quadone.hms.inventory.storagehandlers.MaterialSH.<init>(MaterialSH.java:56)
at com.quadone.hms.inventory.channels.MaterialCH.<init>(MaterialCH.java:98)
at sun.reflect.GeneratedConstructorAccessor64.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:296)
at java.lang.Class.newInstance(Class.java:249)
at com.quadone.hms.channels.testers.ChannelViewer.initializeChannel(ChannelViewer.java:178)
at com.quadone.hms.channels.testers.ChannelViewer.setRuntimeData(ChannelViewer.java:140)
at org.jasig.portal.channels.CError.renderXML(CError.java:208)
at org.jasig.portal.ChannelRenderer$Worker.run(ChannelRenderer.java:501)
at org.jasig.portal.utils.threading.Worker.run(Worker.java:84)


Name and version of the database you are using:
MySQl and
Debug level Hibernate log excerpt:


when i am using mapping files and storage handlers shown above after some time when i am
accessing storage handlers mysql server is giving too many connections.
please help me if anybody knows abt this .
thanks in advance.

_________________
Ravi Kopparapu


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 17, 2004 3:27 pm 
Expert
Expert

Joined: Thu Jan 29, 2004 2:31 am
Posts: 362
Location: Switzerland, Bern
What's a storage handler?

You get the above stack trace after the application is running for some time? If yes, then it looks that you're creating more than one SessionFactory. Each of them may be pooling some db connections ...

If you have only one DB you should have only one SessionFactory. See the reference manual chapter 1.4.

HTH
Ernst


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.