-->
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: JNDI; exception during creation of the ManagedConnection.
PostPosted: Mon Apr 18, 2005 5:20 pm 
Newbie

Joined: Mon Apr 18, 2005 5:02 pm
Posts: 1
Location: Portland
I have a sample program. It works if I use JDBC connection. But when I change to JNDI, it failed. See the error massage below. My JNDI is definitely works since it is used by another program. Please see what is wrong with my hibernate code.

hibernate.cfg.xml, mapping xml and program code are included below.

Thanks for help.
lijao


Hibernate version: 2.1.7
Mapping documents:

hibernate.cfg.xml
<property name="connection.datasource">jdbc/sybDB</property>
<!--
<property name="connection.driver_class">com.sybase.jdbc2.jdbc.SybDriver</property>
<property name="connection.url">jdbc:sybase:Tds:ise-devel8:5000/FNFCM_D</property>
-->
<property name="dialect">net.sf.hibernate.dialect.SybaseDialect</property>
<property name="connection.username">sa</property>
<property name="connection.password">sa</property>
<property name="show_sql">true</property>

------------------------
CD.hbm.xml
<hibernate-mapping>
<class name="CD" table="cm_client">
<id name="id" type="big_decimal" column="cm_client_number">
<generator class="native"/>
</id>

<timestamp column="cm_modify_date" name="purchasedate" unsaved-value="null"/>
<property name="title" column="cm_mother_maiden_name" type="string" not-null="false"/>
<property name="artist" column="cm_birth_name" type="string" not-null="false"/>
</class>
</hibernate-mapping>

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

List cds = session.find("from CD");

Iterator iter = cds.iterator();
while (iter.hasNext()) {
CD cd = (CD)iter.next();
out.println("<tr><td>");
out.println(cd.getId());
out.println("</td><td>");
out.println(cd.getArtist());
out.println("</td><td>");
out.println("no value");
out.println("</td></tr>");
}
}

session.flush();
session.close();


Full stack trace of any exception that occurs:

[4/18/05 13:53:05:688 PDT] 1088ffcf DatasourceCon I net.sf.hibernate.connection.DatasourceConnectionProvider Using datasource: jdbc/sybDB
[4/18/05 13:53:05:703 PDT] 1088ffcf TransactionMa I net.sf.hibernate.transaction.TransactionManagerLookupFactory No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
[4/18/05 13:53:06:109 PDT] 1088ffcf FreePool E J2CA0046E: Method createManagedConnctionWithMCWrapper caught an exception during creation of the ManagedConnection for resource jdbc/sybDB, throwing ResourceAllocationException. Original exception: com.ibm.ws.exception.WsException: DSRA8100E: Unable to get a PooledConnection from the DataSource.
at com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.<init>(DataStoreAdapterException.java:244)
at com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.<init>(DataStoreAdapterException.java:171)
at com.ibm.ws.rsadapter.AdapterUtil.createDataStoreAdapterException(AdapterUtil.java:191)
at com.ibm.ws.rsadapter.DSConfigurationHelper.getPooledConnection(DSConfigurationHelper.java:694)
at com.ibm.ws.rsadapter.spi.WSRdbDataSource.getPooledConnection(WSRdbDataSource.java:440)
at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.createManagedConnection(WSManagedConnectionFactoryImpl.java:566)

Name and version of the database you are using: Sybase 12

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


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.