Status: New
Owner: ----

New issue 595 by [email protected]: PersistModule doesn't bind interceptor for class-level @Transactional annotation
http://code.google.com/p/google-guice/issues/detail?id=595

I was working on a JDBC implementation of guice-persist and noticed that my transactional interceptor wasn't being called if a class was annotated with @Transactional and the methods were not. Currently, the guice-persist tests don't seem to catch it, but if you change the method runOperationInTxn() in ClassLevelManagedLocalTransactionsTest.TransactionalObject to

    public void runOperationInTxn() {
      assertTrue(session.getTransaction().isActive());
      JpaTestEntity entity = new JpaTestEntity();
      entity.setText(UNIQUE_TEXT);
      session.persist(entity);
    }

then testSimpleTransaction() will fail.

PersistModule needs

bindInterceptor(annotatedWith(Transactional.class), any(), getTransactionInterceptor());

added in addition to the single call to bindInterceptor that it currently has.

I think this needs to be fixed before 3.0 is released.

--
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice-dev?hl=en.

Reply via email to