hibernate - In Spring 3.2, should we use @Transactional annotation for db activities? -


i use spring 3.2 , hibernate 4 in project. when query table "no session found current thread" message. try use @transactional annotation(it success) don't want put @transactional every service implementation.

is there way?

in other words "how can simple "insert" operation without using @transaction?"

thx...

@transactional used making java code call in transaction in case exception occurred during process database changes rolled back. in ideal scenario every service think should independent should have @transactional annotation. hibernate want each database calls in transaction thats why have implemented in such way transaction required each database query successful. not sure why wanted service out of transaction still fire database calls.


Comments