Experience with this stuff none whatsoever.
Basically thrown into the code base to support hibernate with nobody to ask questions of. So stepping through the code I can see alot of things occur but how, when, why hibernate functions how it does is beyond me at this point. Frustrated with this idea of having a technology doing something for me when a simple SQL statement would have done what I wanted weeks ago.
ISSUE:
I need to do nothing more than a simple delete from the database of a record. When trying to delete using syntax found elsewhere in the code I get "Session is closed!" exception thrown every time.
The item is independent that I want to remove meaning its not mapped as some child object inside of another object.
There are bits of code where you have something like e.g. A Paper tray object that contains paper objects, or pencil objects if the code executed to remove items is executed it updates the data just fine but, if I have a pencil object by itself and I want to remove it from the database i get that exception.
CODE:
Code:
Session hSession = HibernateUtil.getCurrentSession();
Transaction trans - hSession.beginTransaction();
From the logs It is the beginTransaction() where the exception occurs.
This code throws the Exception "Session is Closed!" what gives?
I need to get this working and have no idea where to look for the answer and if I try and spend time researching this I'm told things like do that on my own time.
Help is desperately needed.