Announcement Announcement Module
Collapse
No announcement yet.
flow managed persistence odd behaviour and problems Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • flow managed persistence odd behaviour and problems

    Hello,

    I've got problems with flow managed persistence, but i'am really clueless how to locate my faults. First I'll list the problems/ the odd behaviour occuring.
    1. The @Service-annotated classes used for database-access via JPA (well, they have an EntittyManager with an @PersistenceContext - Annotation) need to subclass an Interface, which defines their methods, if i use the @Transactional-Annotation on one or more of the methods of the class.
      that means:
      @Service-Class + implements MethodDescribingInterface + @Transactional on method(s) works.
      @Service-Class +@Transactional on method(s) raises an methodNotFound exception.
      The Interface is not annotated and my swf-Setup is identical to the swf-booking-faces-Exampleapplication. The Interface should be of no interest to spring according to my understanding.
    2. When the Flow reaches the end-state, theres no console-output indicating, that there had been any flushing to the database, but in the example-application theres an insert and an update. In my application there are inserts preceeding the final state. I'm not sure what that means,
      but i would guess flow managed persistence is not working.
      the flow has the <persistence-context/> element
    To be honest the documentation for flow-managed persistence is quite short and not very detailed. Im unable to figure out how to annotate my methods the right way, when do i need @Transactional, @Transactional(read-only = true) or possibly no annotation at all.

    Any Help would be really appreciated, im really puzzled.

  • #2
    Originally posted by b.knarf View Post
    Hello,

    I've got problems with flow managed persistence, but i'am really clueless how to locate my faults. First I'll list the problems/ the odd behaviour occuring.
    1. The @Service-annotated classes used for database-access via JPA (well, they have an EntittyManager with an @PersistenceContext - Annotation) need to subclass an Interface, which defines their methods, if i use the @Transactional-Annotation on one or more of the methods of the class.
      that means:
      @Service-Class + implements MethodDescribingInterface + @Transactional on method(s) works.
      @Service-Class +@Transactional on method(s) raises an methodNotFound exception.
      The Interface is not annotated and my swf-Setup is identical to the swf-booking-faces-Exampleapplication. The Interface should be of no interest to spring according to my understanding.
    2. When the Flow reaches the end-state, theres no console-output indicating, that there had been any flushing to the database, but in the example-application theres an insert and an update. In my application there are inserts preceeding the final state. I'm not sure what that means,
      but i would guess flow managed persistence is not working.
      the flow has the <persistence-context/> element
    To be honest the documentation for flow-managed persistence is quite short and not very detailed. Im unable to figure out how to annotate my methods the right way, when do i need @Transactional, @Transactional(read-only = true) or possibly no annotation at all.

    Any Help would be really appreciated, im really puzzled.
    When using FMPC, your service methods must be non-transactional, unless they are marked with readOnly=true. In addition, your JPA vendor must support FlushMode MANUAL.

    Currently, Spring's JpaTransactionManager changes flush mode to manual if underlying jpa vendor is Hibernate, when any tx is marked as readyOnly.

    Comment

    Working...
    X