I know function calls to services should be in a transaction.

but what about caching aspect?

option A
"beanServiceTarget" - non proxied service
"beanServiceTransaction" - a transaction proxy for "beanServiceTarget"
"beanService" - a cache proxy for "beanServiceTransaction"

so call to "beanService.findItem(String id)" might not even hit the db and no transaction were ever started.

option B
"beanServiceTarget" - non proxied service
"beanServiceCache" - a cache proxy for "beanServiceTarget"
"beanService" - a transaction proxy "beanServiceCache"

so call to "beanService.findItem(String id)" might not even hit the db but a transaction might be started (i'm not sure about this).


or
Option C

"beanDao1Target" - a non-proxied dao
"beanDao2Target" - a non-proxied dao
"beanDao1" - a cache proxy for "beanDao1Target"
"beanDao2" - a cache proxy for "beanDao2Target"
"beanServiceTarget" - non proxied service, uses "beanDao1" and "beanDao2"
"beanService" - a transaction proxy "beanServiceCache"

so call to "beanService.findItem(String id)" might not even hit the db but a transaction might be started (i'm not sure about this). Furthermore, i'm not sure if the dao should be proxied.

so... any suggestions how i should use cache proxy and transaction proxy together? or is there a cowboy neal way that i haven't figured out yet..