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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -