-->
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.  [ 3 posts ] 
Author Message
 Post subject: No CurrentSessionContext configured
PostPosted: Thu Feb 15, 2007 6:26 pm 
Newbie

Joined: Thu Feb 15, 2007 6:09 pm
Posts: 7
ich habe das beispiel von http://www.hibernate.org/hib_docs/v3/re ... orial.html

Session session = HibernateUtil.getSessionFactory().getCurrentSession();
session.beginTransaction();
Projekt p = new Projekt();
p.setProjektnameGer("test");
session.save(p);
session.getTransaction().commit();
HibernateUtil.getSessionFactory().close();

leicht modifiziert übernommen. leider spuckt der compiler
immer die fehlermeldung No CurrentSessionContext configured
aus.

Ich nehme mal an das ich noch irgendwo mitteilen muss wo bzw welche configurations datei er hat.

was ich nun nicht verstehe ist was fehlt. eigentlich müsste es ja gehen oder nicht?

ich verwende hibernate und hibernate tools

danke


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 20, 2007 12:01 pm 
Expert
Expert

Joined: Tue Dec 07, 2004 6:57 am
Posts: 285
Location: Nürnberg, Germany
setze das property hibernate.current_session_context_class in der hibernate konfiguration auf thread (bzw auf jta wenn im appserver betrieben)

_________________
Please don't forget to rate


Top
 Profile  
 
 Post subject: Super Danke
PostPosted: Wed Feb 21, 2007 2:07 am 
Newbie

Joined: Thu Feb 15, 2007 6:09 pm
Posts: 7
jo so gehts! Allerdings verstehe ich nicht warum Hibernate das genauso wie die zu mapping files vergisst. naja danke erstmal


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.