Is there still need to use @Transactional annotation in Spring if the data store is MongoDB -
a typical spring-mvc based crud application has following layout.
the controller layer
@controller public class webcontroller{ @inject userservice userservice; ... } the service layer
@service @transactional public class userserviceimpl{ @inject userdao userdao; } and dao layer
@repository public class userdaoimlp{ @inject sessectionfactory session; } with use of spring annotations, @controller, service, @repository, , @transactional, can take advantage features spring. example, if data store using traditional database such mysql, @transactional annotation can make sure transaction completed. if use mongodb data store, , mongodb not support transaction, there still advantage use @transactional annotation? , how @service , @repository layers?
Comments
Post a Comment