How can i get current session used by @Transactional annotation in Hibernate/Spring Data?

Viewed 5782

I have been executing stored procedure using Callable statement from datasource. Now this procedure has to read data from an insert query executed just before SP execution in same service. so this creates a problem as the whole service is wrapped around a @Transactional annotation and commit is only done after service completes. So , is there any way to get the current session of current @Transactional annotation . getCurrentSession of SessionFactory is giving me a differrent session.

2 Answers
Related