we have a function with @Transactional
and it has a if expression. when its true we must return list(with manipulated it!!) and in else expression we must Save a entity!! but when that return my list , it Update my list in Database.
- we use else expression in a function with
@Transactional(readOnly=true)
but it doesn't work. - we use else expression in a function in the other Service Class with
@Transactional(readOnly=true)
but it doesn't work either
so we use session.envict(myobjects) to detach this Object !! but We don't think it's best way...
Is there a better way?