java - Data does not persist using HIbernate with Spring's @Transactional Annotation -
I have an application that I am currently writing that will use spring and hibernate in the level of my services For a grin that has done a very basic CRUD-ing operation, I have commented as follows:
@ Transactional (read only = false, Propagation = Proposition.quares_nu) universal Nick zero to some work (dao dao, entity e) {/ Search Daokpersist (e); Dao.findAll (Entity.clz); }
Dao then looks like this:
public zero existence (unit E) {session.saveOrUpdate (e); // it has already been created using a SessionFactory}.
Search all methods look like this
Public Zero Search All (class clause) {session.createCriteria (CLZ) .list (); }
Now, everything starts running, okay after inserting my object, I have all the methods to find it (the new primary key ID, which was assigned by the data store) However, if the "doSomeWork" method is complete, my data does not actually exist in the built-in datastore (Oracle 10G)
If, I remove the @transactional annotation And subdomain of hibernate session Industry does Hunktrensakshn (). Begin () and session.getTransaction (). Commit () (or rollback), the code works as I used to anticipate.
So, my basic question will be: Does Hibernation really use spring transaction management for real transaction management?
In my Bean-Config file, I am declaring a TransactionManager Bean, a factory Bean of a session, and I am also included in the config file.
Being in spring and hibernation, possibly, can be remembered for better work knowledge?
Comments
Post a Comment