For the session and transaction injection to happen throught the plug-in the org.hibernate. Session and org.hibernate.Transaction objects should be declared as class variables and not at method level. You can keep these variables in a generic DAO class and extend all the other DAO's from it.
When using this plug-in there is no need to explicitly commit the transaction and close the session, both will be done automatically.
The "transaction.rollback()" should be used only in the methods that updates the database.
In the hibernate configuration file, we configure it to work with the hsqldb database.