hibernate - Spring - inner methods called by @Transactional(readOnly = true) method to write -
if method has annotation @transactional(readonly = true), there way allow inner methods write?
example:
class { @transactional(readonly = true) public void readfoo(){ b.writefoo(); } } class b { public void writefoo(){} }
i know sort of defeats purpose of having readonly annotation want know if there's way.
readonly
attribute of @transaction
annotation hint transaction manager. depends on underlying technology use manage transactions. can optimize transactions read-only performance (hibernate) or can ignore readonly
attribute @ all.
i think if annotate writefoo()
i.e.
@transactional(readonly = false, propagation = propagation.nested)
it can act independently on parent read-only transaction , write without problems. haven't tested myself.
Comments
Post a Comment