I've been starting to use Spring's @Transactional
annotation, and it provides a lot of convenience for managing transactions. However, using this annotation in our code now makes us dependent on Spring. I know with JPA type stuff there is a javax persistence package where we can mark up the code with all sorts if JPA annotations, but since they all come from javax.persistence
, our code isn't dependent on any specific implementation or ORM.
I guess my question is if there are any similar annotations for transactional stuff. I found a javax jta package, but I'm not sure there's really any generic annotations that Spring could implement. Basically I'm just wondering if there's any kind of generic javax-like annotations that we can put on methods to manage transactional functionality so that we aren't dependent on Spring.