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]