-->
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: how to resolve the problem in the hibernate reference 3.1rc
PostPosted: Wed Nov 02, 2005 3:58 am 
Newbie

Joined: Wed Nov 02, 2005 3:42 am
Posts: 5
I wrote files and dirs according to the references. all the files compiled successfully .But when use the ant to build the file. i can't insert data into database ,nor can i query the database.
Once keypressed :ant run -Daction=store
there are many INFO listed ,and at the end together with the failed info :

[java] 15:32:42,531 INFO Configuration:1027 - processing association prope
rty references
[java] 15:32:42,531 INFO Configuration:1049 - processing foreign key const
raints
[java] 15:32:42,562 INFO TableMetadata:40 - table found: sample.events
[java] 15:32:42,578 INFO TableMetadata:41 - columns: [event_id, title, eve
nt_date]
[java] 15:32:42,578 INFO TableMetadata:43 - foreign keys: []
[java] 15:32:42,578 INFO TableMetadata:44 - indexes: [primary]
[java] 15:32:42,578 INFO SchemaUpdate:162 - schema update complete
[java] 15:32:42,578 INFO DriverManagerConnectionProvider:147 - cleaning up
connection pool: jdbc:mysql://localhost:3306/sample
[java] 15:32:42,578 INFO SessionFactoryImpl:432 - Checking 0 named queries

[java] Exception in thread "main" org.hibernate.HibernateException: No Curr
entSessionContext configured!
[java] at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(Sessi
onFactoryImpl.java:602)
[java] at EventManager.createAndStoreEvent(Unknown Source)
[java] at EventManager.main(Unknown Source)
[java] Java Result: 1

i have changed the EventManager.java and HibernateUtil.java according to someother's examples,it can work,but ,i want to use just the example,how to resolve it .thank you .!


Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

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

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 04, 2005 8:49 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
Like it says - No CurrentSessionContext configured!

Read about this in theri blog: http://blog.hibernate.org/cgi-bin/blosx ... ntext.html


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.