Question

I would like to change the Transaction attributes (especially the TransactionManager ) during runtime via reflection. Is this possible?

eg: @Transactional('ChangeMe')

Was it helpful?

Solution

As fare as I know, Java has no function to modify the annotations at runtime.

But you can use programmatic transaction management, instead of the annotation.

On the other hand you can try to modify springs declarative transaction management, to enable and disable the transactions by some List or Map, but not by reflection.

Additional references:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top