Closed nobeans closed 11 years ago
Why don't you make a copy of that method without the transaction handling and see how it works out for you? It's been a while, but I remember running into some strange issues with that piece of code.
sure. I can do it and actually did it. But I think in almost case you must want to control a transaction out of the service. So I want a way to control it by default if possible.
but I remember running into some strange issues with that piece of code.
it's when using only new session without new transaction?
What problem have you met before you committed the following commit?
commit 0874bfe641a8c330bdac97afca7d0fc4ff4aa053
Author: Kim A. Betti <kim.betti@gmail.com>
Date: Sat Feb 19 18:41:11 2011 +0100
Made doWithTentant run within a new transaction to avoid the previous tenant-id leaking in
If any problem may occurs when using my service which doesn't start both new session and new transaction, I can't use it.
You probably have to investigate it. I never really got to the bottom of that problem and it's so long ago that I don't remember the details of it.
ok. I think that new transaction is unnecessary. so I try to use my service which uses only new session. If something happen, I'll report newly. thanks.
from javadoc comment
If the problem is caused by the first level cache, I think it can be fixed by using only new session or a current session after calling
clear()
instead. a forced individual transaction is inconvenient for me. I want to control a transaction by myself out of the service.