Ulf Dittmer wrote:Which object is null?
Ulf Dittmer wrote:Why do you think it's necessary to close the session factory?
But I don't understand those lines of code at all - it seems you're starting a transaction, and then immediately commit it, before anything could have happened in it. What is that supposed to accomplish?
James Boswell wrote:
On line 6, you are closing the SessionFactory when I think you should be closing the Session instead.
Ulf makes a very good point about doing nothing within your transaction.
that is how they finished the hibernate interaction
James Boswell wrote:
that is how they finished the hibernate interaction
Well I cannot think of a reason to close the SessionFactory while your application is running. SessionFactory is quite heavyweight so I would have thought closing and re-opening one would be expensive.
The Javadocs for the class also imply that an application will only have a single instance:
SessionFactory Javadoc
Don't get me started about those stupid light bulbs. |