spring - Entity getting saved without @Transactional -
we facing issue related spring @transactional
, have controller , service class, though service class not marked @transactional
, entity getting saved. using @enabletransactionmanagement(proxytargetclass = true)
, openentitymanagerinviewinterceptor
spring data jpa. guess info may not sufficient insight on possible reasons behavior. few logs before entity persistence
2016-01-07 20:58:15,393 debug [org.springframework.data.repository.core.support.transactionalrepositoryproxypostprocessor$customannotationtransactionattributesource] (default task-23) adding transactional method 'save' attribute: propagation_required,isolation_default; '' 2016-01-07 20:58:15,393 debug [org.springframework.transaction.jta.jtatransactionmanager] (default task-23) creating new transaction name [org.springframework.data.envers.repository.support.enversrevisionrepositoryimpl.save]: propagation_required,isolation_default; '' 2016-01-07 20:58:15,394 debug org.hibernate.engine.transaction.internal.transactioncoordinatorimpl] (default task-23) skipping jta sync registration due auto join checking 2016-01-07 20:58:15,394 debug [org.hibernate.engine.transaction.internal.transactioncoordinatorimpl] (default task-23) skipping jta sync registration due auto join checking 2016-01-07 20:58:15,394 debug [org.hibernate.engine.transaction.internal.transactioncoordinatorimpl] (default task-23) registered synchronization 2016-01-07 20:58:15,394 debug [org.hibernate.jpa.spi.abstractentitymanagerimpl] (default task-23) looking jta transaction join 2016-01-07 20:58:15,394 debug org.springframework.orm.jpa.extendedentitymanagercreator$extendedentitymanagerinvocationhandler] (default task-23) joined jta transaction 2016-01-07 20:58:15,394 debug org.springframework.beans.factory.support.defaultlistablebeanfactory] (default task-23) returning cached instance of singleton bean 'jpaauditinghandler' 2016-01-07 20:58:15,417 debug [org.springframework.transaction.jta.jtatransactionmanager] (smsqueuelistenerbean-1) initiating transaction commit 2016-01-07 20:58:15,417 debug [org.springframework.transaction.jta.jtatransactionmanager] (smsqueuelistenerbean-1) creating new transaction name [smsqueuelistenerbean]: propagation_required,isolation_default 2016-01-07 20:58:15,418 debug [org.springframework.transaction.jta.jtatransactionmanager] (emailqueuelistenerbean-1) initiating transaction commit 2016-01-07 20:58:15,418 debug [org.springframework.transaction.jta.jtatransactionmanager] (emailqueuelistenerbean-1) creating new transaction name [emailqueuelistenerbean]: propagation_required,isolation_default 2016-01-07 20:58:15,459 debug [org.springframework.transaction.jta.jtatransactionmanager] (default task-23) participating in existing transaction 2016-01-07 20:58:15,459 debug [org.springframework.transaction.jta.jtatransactionmanager] (default task-23) participating in existing transaction 2016-01-07 20:58:15,460 debug [org.hibernate.engine.jdbc.internal.logicalconnectionimpl] (default task-23) obtaining jdbc connection 2016-01-07 20:58:15,461 debug [org.hibernate.engine.jdbc.internal.logicalconnectionimpl] (default task-23) obtained jdbc connection 2016-01-07 20:58:15,463 debug [org.hibernate.loader.plan.exec.process.internal.resultsetprocessorimpl] (default task-23) starting resultset row #0 2016-01-07 20:58:15,463 debug [org.hibernate.loader.plan.exec.process.internal.entityreferenceinitializerimpl] (default task-23) on call entityidentifierreaderimpl#resolve, entitykey known; should happen on root returns optional identifier specified 2016-01-07 20:58:15,464 debug [org.hibernate.engine.jdbc.internal.logicalconnectionimpl] (default task-23) releasing jdbc connection 2016-01-07 20:58:15,465 debug [org.hibernate.engine.jdbc.internal.logicalconnectionimpl] (default task-23) released jdbc connection
to sum discussed in comments: simplejparepository default implementation of jparepository interface. if @ implementation, can see that, default, using read-only transaction (for methods findall, ...), , deleting or saving services, annotated @transactional. qef.
Comments
Post a Comment