On Sat, Dec 29, 2012 at 8:34 PM, Ashley Aitken <mrhat...@mac.com> wrote: >> Having used to actively develop Cayenne applications, but more >> recently having to develop using JPA, which uses an AR approach, I can >> say that it doesn't actually work or help to mix AR and Unit-of-work >> Cayenne DataContext concepts. You end up trying to imitate a >> scratchpad area using a database transaction, which leaves an ongoing >> open database connection for each DataContext. JPA entities don't >> have any easy way to be worked on as a group short of an active >> database transaction. > > I understand that JPA group actions (e.g. saves) are tied to a database > transaction but I don't see why you feel this is an AR approach? AR to me is > when you call save, for example, on individual objects etc. > > AR for me is more synonymous with RubyOnRails. That said, there is > apparently an ActiveRecord implementation for Java, called ActiveJDBC (see > Wikipedia).
You know what. You're absolutely right. My coworkers implemented an AR scheme on top of JPA where entity.save() calls em.persist() -- JPA itself isn't AR. My bad. So really, JPA is the worst of both worlds :-)