I'm developing online application that has several pages described as follows.
The "Create" page has several tabs. When the user switchs between tabs (or clicks on save button), all data on that form must be saved to the database.
When the use navigates to the list page, all data will be fetched from the DB and viewed.
Then, the user can select a record from the list to update. In that case, the data will be viewed in tabs (as in the Create page) and all data will be saved to the DB when switching between tabs or clicking save button.
The user can delete records from some tables.
Where are the optimal places to open and close session?
I think that the session can be created when the main page is loaded but where to close the session?
Thanks a lot in advance!
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html