-->
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: The user must supply a JDBC connection
PostPosted: Tue Sep 16, 2003 4:25 am 
Newbie

Joined: Fri Aug 29, 2003 10:03 am
Posts: 5
I am using hibernate 2.0.3 in JBoss. It's not configured as an EJB service, it is just used in some classes. The configuration is read and used in the following fashion:
conf.addInputStream(this.getClass().getResourceAsStream("hibernate.cfg.xml"));
SessionFactory sf = cfg.buildSessionFactory();
Session sesna = this.newSession();
sesna.beginTransaction();

When I want to start a new transaction an exception apears:
java.lang.UnsupportedOperationException: The user must supply a JDBC connection
at net.sf.hibernate.connection.UserSuppliedConnectionProvider.getConnection(UserSuppliedConnectionProvider.java:32)
at net.sf.hibernate.impl.SessionFactoryImpl.openConnection(SessionFactoryImpl.java:396)
at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:2914)
at net.sf.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:39)
at net.sf.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransactionFactory.java:22)
at net.sf.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1981)
...my methods

The configuration looks like this:

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">

<hibernate-configuration>
<session-factory name="java:comp/env/hibernate/SessionFactory">

<property name="hibernate.connection.url">jdbc:postgresql://machine.somewhere.cz:1234/satai</property>
<property name="hibernate.connection.username">satai</property>
<property name="hibernate.connection.password"></property>
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.connection.pool_size">50</property>
<property name="hibernate.statement_cache.size">50</property>
<property name="hibernate.dialect">net.sf.hibernate.dialect.PostgreSQLDialect</property>

<mapping resource="chamurabi/imp/Predmet"/>
<mapping resource="chamurabi/imp/Pravo"/>
<mapping resource="chamurabi/imp/NastavenePravo"/>
</session-factory>

When I tried to google "The user must supply a JDBC connection" i get only two links and no one seems to be relevant. Does anybody have a hit what to do?


Top
 Profile  
 
 Post subject: Re: The user must supply a JDBC connection
PostPosted: Mon Mar 07, 2011 6:21 am 
Newbie

Joined: Fri Mar 20, 2009 11:55 am
Posts: 2
The same probleam :https://forum.hibernate.org/viewtopic.php?f=1&t=963172&start=0


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.