Title:
Bug 80873:EntitySave() inside PostInsert() event handler is silently ignored
| View in TrackerStatus/Resolution/Reason: Closed/Withdrawn/
Reporter/Name(from Bugbase): Henry Ho / Henry Ho (Henry Ho)
Created: 11/30/2009
Components: ORM Support
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 0000 /
Priority/Frequency: Normal / Unknown
Locale/System: English / Platforms All
Vote Count: 0
Problem:
EntitySave() inside PostInsert() event handler is silently ignored. With ormsettings.logSQL = true, no statements related to the ignored entitySave() are generated by hibernate.ormFlush() at the end of postInsert yields org.hibernate.SessionException: Session is closed! This is related to - http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:59814#324918- http://groups.google.com/group/cf-orm-dev/t/442177447d389c5
Method:
// test.cfccomponent persistent="true"{ property id; property num; void function postInsert() { variables.num = 123; entitySave(this); //ormFlush(); // without this = ignore, with this = org.hibernate.SessionException: Session is closed! }}<!--- test.cfm ---><cfscript>test = new test();test.setid(1);entitySave(test);</cfscript>
Result:
Session is closed!Root cause :org.hibernate.SessionException: Session is closed! org.hibernate.SessionException: Session is closed!at org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:72)at org.hibernate.impl.SessionImpl.getJDBCContext(SessionImpl.java:1891)at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:328)at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)at coldfusion.orm.hibernate.SessionWrapper.flush(SessionWrapper.java:167)at coldfusion.orm.hibernate.HibernateSessionManager.flushSession(HibernateSessionManager.java:58)at coldfusion.orm.SessionManager.flushCurrentSession(SessionManager.java:83)at coldfusion.orm.hibernate.HibernatePersistenceManager.onPageRequestEnd(HibernatePersistenceManager.java:948)at coldfusion.orm.hibernate.HibernatePersistenceManager$HibernateEventListener.onPageRequestEnd(HibernatePersistenceManager.java:1036)at coldfusion.filter.ApplicationFilter.firePageRequestEnd(ApplicationFilter.java:508)at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:384)at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)at coldfusion.filter.PathFilter.invoke(PathFilter.java:87)at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27)at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:53)at coldfusion.CfmServlet.service(CfmServlet.java:200)at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)at jrun.servlet.FilterChain.service(FilterChain.java:101)at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3040471
External Customer Info:
External Company:
External Customer Name: Henry Ho
External Customer Email: 237A22C24921EDF5992015B9
External Test Config: 11/30/2009
Attachments:
Comments: