BaseORMService Error Messages: Session is closed

Anyone see this one before? I'm getting the error:

Application Execution Exception
Error Type: org.hibernate.SessionException : [N/A]
Error Messages: Session is closed

LINE: 624
Template: E:\web\sites\cf9.local\webapps\ROOT\coldbox\system\orm

every time I try to persist a new entity using the base orm service.

Interestingly enough, if I pull the save routine out of the base orm
service and run it in my handler I don't get the error.



Check your hibernate logs. I have seen this error if I didn't have my
generator set properly and I didn't populate my ID. Also, you can try
setting the flush=true.

Curt Gratz
Computer Know How

Hey Curt - You're right, my ID wasn't being set (it's assigned).
Thanks for the quick reply.


No problem.

I just had this issue yesterday and scratched my head until I looked at my hibernate logs.

Curt Gratz

So news to me... you can't use the preInsert event to set an assigned
ID because the error is thrown before the event is called.