-->
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: löschen -> database synchronisation-problem
PostPosted: Fri Jun 15, 2007 12:33 pm 
Newbie

Joined: Fri Jun 15, 2007 12:15 pm
Posts: 1
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Tomcat 5.5.23
Mapping documents:

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

public abstract class DAO<T> {

private static Log log = LogFactory.getLog(DAO.class);
private String classname;
private String tablename;
public DAO(String classname, String tablename) {
this.classname = classname;
this.tablename = tablename;
HibernateUtil.beginTransaction();

}


public void delete(T o) {
HibernateUtil.getSession().delete(o);
}


lösche_handler

CustomersDAO cdao = new CustomersDAO();
cdao.delete(this.customer);


Full stack trace of any exception that occurs:

Name and version of the database you are using:
hsqldb.1.8.0.0.


Hallo allerseits..

Habe folgendes Problem: Beim erstellen eines Web-Shops sollen Kunden, Produkte etc. in die DB aufgenommen werden. Die DB selbst hat schon Einträge, aus einer Script datei. Dabei funktioniert das Schreiben einwandfrei. Das Löschen jedoch funktioniert nur bei Daten, die ich selbst eingetragen habe. Beim Versuch bereits vorhandene Datensätze zu löschen wirft Tomcat die Meldung "Could not synchrnize database with session".
Jemand eine Idee woran's liegen kann???


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 21, 2007 5:44 am 
Newbie

Joined: Tue Jun 19, 2007 5:12 am
Posts: 3
Hallo,

versuch mal

HibernateUtil.getSession().beginTransaction();
HibernateUtil.getSession().delete(o);
HibernateUtil.getSession().commitTransaction();

Viele Grüße,
Gun


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.