lundi 20 avril 2015

Autowiring sessionFactory in service layer

Currently I am autowiring sessionfactory in my service class just for the sake of transaction management.I am creating (Hibernate)sessions in the service and based on the repsonse from DAO layer,performing transaction commit/rollback.

My business logic requires me to update more than two database tables in single transaction.

From design perspective,I am rather skeptical to autowire sessionFactory in service layer.

Is there any other alternative to do so?

Thanks

Aucun commentaire:

Enregistrer un commentaire