Announcement

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

    performCustomOperation and Custom Datasource

    Trying to figure out how in the world performCustomOperation is being executed with out using my custom DS.

    My Custom DS filled with logging


    Much has been omitted but I think this should be enough to get validate that my custom ds should be performing the operation, and yet it is completely circumvented by one of your underlying classes execute and executeCustom.
    Any suggestions on what is going wrong here?
    Last edited by jpappalardo; 24 Sep 2014, 09:38.

    #2
    Not sure what you're surprised by here - you know that DMIs are executed before DataSource.execute(), right? See the QuickStart Guide's discussion of how requests are processed in the Server Framework chapter.

    Comment


      #3
      Thank you for pointing out what I was doing that was causing unexpected results. The reality is that what I'm trying to do is an update, and after finally figuring out how to get an operationbinding to be marked as allowMultiUpdate I'm finally able to go down that road. What I need help with now is how do I get something other than null from my custom ds for an entity manager.

      the EAO I am calling allows an em to be passed in to use to do the operation, which I believe would alleviate the following issues the container reports trying to do this operation.



      I have tried
      this.em
      this.connectionHolder
      Datasource.getTransactionObject(req)

      all of which give me a null value for em.
      Last edited by jpappalardo; 24 Sep 2014, 09:39.

      Comment


        #4
        To avoid getting into the black magic of how the container is managing exactly when the connection is killed, you could mark the videoStreamDestinations Collection to use Eager fetching via JPA annotations, or in your DMI you could simply call the accessor (presumably getVideoStreamDestinations()) and iterate over the collection to force fetching.

        Comment


          #5
          Is that to say there is no way for me to get the EntityManager my custom DS is using?

          Comment


            #6
            If you look at the JPAIntegration overview there's a detailed explanation of how you can control the creation of the EntityManager and thereby configure what you want and end up with a reference to it. But the approaches suggested above are a lot simpler.

            Comment

            Working...
            X