Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    ManyToMany in a ListGridField

    I have a datasource that includes a many to many relationship. I am able to successfully use this datasource in a DynamicForm, but when I try to use it in a ListGrid I get transaction issues, unless I hide the many to many field.

    excerpt from security lookup entity

    security lookup ds.xml


    The result in the server logs

    I have a DynamicForm bound to the same datasource that allows me to successfully view, add, edit, save. So what am I doing wrong in the ListGrid?

    dynamic form


    list grid


    The list grid is essentially to be the view of all records, and the dynamic form is used to edit existing and new records. We do not edit in the grid itself. Any help is greatly appreciated.
    Last edited by jpappalardo; 24 Sep 2014, 09:27.

    #2
    I have also found another way to reproduce the exact same exception.

    videostream.ds.xml


    videostreamdestinations.ds.xml


    the relationship in the entity


    When I create a video stream, with a destination all goes well. However, if I try to add a destination to a video stream it blows up.


    If I remove the creator field from the video stream destination the issue then goes away.

    Any thoughts on this?
    Last edited by jpappalardo; 24 Sep 2014, 09:27.

    Comment


      #3
      Hi,

      My guess is: you are mixing transaction-scoped persistence context and extended persistence context. It is suggested by exception:
      15:16:53,524 INFO [stdout] (http--0.0.0.0-8080-2) Caused by: javax.ejb.EJBException: JBAS011437: Found extended persistence context in SFSB invocation call stack but that cannot be used because the transaction already has a transactional context associated with it. This can be avoided by changing application code, either eliminate the extended persistence context or the transactional context. See JPA spec 2.0 section 7.6.3.1. Scoped persistence unit name=gsui.war#gs2, persistence context already in transaction =ExtendedEntityManager [gsui.war#gs2], extended persistence context =ExtendedEntityManager [gsui.war#gs2].
      Do you use SFSB (Stateful Session Beans)?
      Do you use @TransactionAttribute annotation in your code?

      Regards,
      Alius

      Comment


        #4
        No, not at all. It is JPA2DataSource executing the requests.

        There is one update operation I execute myself, in this DataSource and it is not the cause of either of the exceptions. As you can see in the code my custom ds allows smartgwt to handle the actual persistence, and then I catch the response to send server messages to notify some server logic about certain entity changes, and realtime messaging to keep all clients view of the db in synch.

        RTMDataSource
        Last edited by jpappalardo; 24 Sep 2014, 09:28.

        Comment


          #5
          Hi,

          FYI: I think I've found an issue with "creator" field.

          It will take some time to investigate and correct.

          I will keep you informed.

          Regards,
          Alius

          Comment


            #6
            Hi,

            I've just committed changes.
            You can pick it with next nightly build.

            Please inform me about your results.

            Regards,
            Alius

            Comment


              #7
              If this fix was intended to help with displaying the many to many, it does not work.

              If this fix was intended to help with setting creator names in entities that have child entities, I already switched all creator fields to text and just set them myself on the server.

              Comment


                #8
                From the timestamps on the posts, you picked up a new nightly too soon to get the changes.

                Comment

                Working...
                X