Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
322
<!DOCTYPE hibernate-configuration PUBLIC '-//Hibernate/Hibernate Configuration DTD 3.0//EN' 'http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd'>
<hibernate-configuration>
<session-factory>
<!-- Database connection settings -->
<property name="connection.driver_class">org.firebirdsql.jdbc.FBDriver</property>
<property name="connection.connection.url">jdbc:firebirdsql:localhost/3050:D:/Files/dycept/Extern/SW_Dlite/Code/PracticeDB/TEST_Hibernate.fdb</property>
<property name="connection.username">SYSDBA</property>
<property name="connection.password">berlin</property>
<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">2</property>
<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.FirebirdDialect</property>
<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>
<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">false</property>
<!-- Drop and re-create the database schema on startup -->
<!--- <property name="hbm2ddl.auto">create</property> -->
<mapping resource="POJOs/Friend.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Mapping documents:
<!DOCTYPE hibernate-mapping PUBLIC '-//Hibernate/Hibernate Mapping DTD 3.0//EN' 'http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd'>
<hibernate-mapping>
<class name="POJOs.Friend" table="PERSONEN">
<id name="id" column="PERSONEN_ID">
<generator class="native"></generator>
</id>
<property name="Vorname" column="VORNAME"></property>
<property name="Nachname" column="NACHNAME"></property>
<property name="Alter" column="ALTER"></property>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
public static void main(String[] args) {
Session mySess = HibernateUtil.getSessionFactory().getCurrentSession();
mySess.beginTransaction();
mySess.getTransaction().commit();
}
Full stack trace of any exception that occurs:
Exception in thread "main" java.lang.UnsupportedOperationException: The user must supply a JDBC connection
at org.hibernate.connection.UserSuppliedConnectionProvider.getConnection(UserSuppliedConnectionProvider.java:30)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)
at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:301)
at $Proxy0.beginTransaction(Unknown Source)
at hibertest.Main.main(Main.java:34)
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)
Name and version of the database you are using:
firebird with jaybird 2.0.1
Debug level Hibernate log excerpt:
what the ...?
The Error above drives me crazy I can´t find solutions on the web so i guess i am missing out on something, that is so easy, that i can´t see it.
The error shown above accurs in the line:
mySess.beginTransaction();
Need help
Bitte
Haspost