AnsweredAssumed Answered

Transactions and Repository Actions

Question asked by pjaromin on Sep 17, 2012
Latest reply on Sep 19, 2012 by pjaromin
I have an external process that renders repository content based on node properties. This is facilitated by a repository Action that calls on this external application. The external application in turn makes calls back to the repository to gather key bits of information used in the rendering process before rendering the content and handing it as a stream back to the calling Action.

Thus far this has worked brilliantly.

However, now I've got an Action that generates a *new* node/document. It then calls out to the external process (this is actually facilitated through applying an Aspect with an onAddAspect behavior) to render the content.

Unfortunately, the new node is not yet available to the external process until after the action completes, which results in the rendering process failing.

I assume this is because the primary Action is executed within a single transaction and that the new node is only committed following the completed execution of the action. I've tried creating new user transactions and wrapping the node create in one hoping that this would result in the node being available to the external process before the main Action completes. I've also attempted to create the new node in a separate action call. Neither worked.

I've been thinking about this for some time and haven't hit upon a satisfactory work-around. Is there some mechanism that I might use in this situation? Is there some way to create a "deferred" process that would run following the Action commit?

Any insight/suggestions would be greatly appreciated.

Thanks!

Outcomes