-->
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: org.hibernate.TransactionException: Transaction not successf
PostPosted: Wed Mar 21, 2007 5:31 pm 
Newbie

Joined: Wed Mar 07, 2007 12:43 pm
Posts: 10
Hallo,

ich bekommen in dem Codefragment

Code:
        try {
            Transaction tx = session.beginTransaction();
           
            Teilnehmer teilnehmer = (Teilnehmer) session.get(Teilnehmer.class, teilnehmerid);
            if (archive != teilnehmer.getArchiv()) {
                teilnehmer.setArchiv(archive);
                session.update(teilnehmer);
                LogLogic.createLog(session, user, Constants.LOG_MODIFYE, "Update: "+teilnehmer);
            }
           
            tx.commit();
            retVal = true;
        } catch (Exception ex) {
            logger.error("Exception in archive", ex);
        }


die Exception

Code:
2007-03-21 22:15:05,175 ERROR [http-8084-Processor22] (TeilnehmerLogic.java:375) - Exception in archive
org.hibernate.TransactionException: Transaction not successfully started
   at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:100)
   at de.uniulm.coronaNG.logic.TeilnehmerLogic.archive(TeilnehmerLogic.java:372)
   at de.uniulm.coronaNG.actions.user.ArchivAction.execute(ArchivAction.java:87)
   at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
   at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
   at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
   at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at de.uniulm.coronaNG.security.UserFilter.doFilter(UserFilter.java:91)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
   at java.lang.Thread.run(Thread.java:613)
2007-03-21 22:15:05,234 DEBUG [http-8084-Processor22] (ArchivAction.java:116) - Action took 188ms.


... an der Stelle
Code:
            tx.commit();


An vielen anderen Stellen im Programm läuft der Code in ähnlicher Form immer prima und ohne Exception, die Datenbankanbindung (PostgreSQL 8 unter Mac OS X) scheint daher in Ordnung zu sein.

Weiss jemand, wieso eine Transaction nicht erfolgreich gestartet werden soll? (Anmerkung: diese Exception tritt erst seit Neuestem auf, ich etwas Code geändert und auf die aktuellste Hibernate-Version gewechselt).

Grüße,
Christian[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 27, 2007 4:36 pm 
Expert
Expert

Joined: Tue Nov 23, 2004 7:00 pm
Posts: 570
Location: mostly Frankfurt Germany
Das codefragment sieht eigentlich fehlerfrei aus. Wird die session evt. in mehreren Threads parallel benutzt?

Wenn nein, dann vielleicht einfach einen kleinen Testcase erzeugen, der das Verhalten aufweist und diesen hier mit allen Config Files posten

_________________
Best Regards
Sebastian
---
Training for Hibernate and Java Persistence
Tutorials for Hibernate, Spring, EJB, JSF...
eBook: Hibernate 3 - DeveloperGuide
Paper book: Hibernate 3 - Das Praxisbuch
http://www.laliluna.de


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.