Andy,

After looking at my and Jena code, I really can't think how it's possible not 
calling finishRequest.

I make the caller code, explicitly call graph dataset close(), which I added 
code to make flush call there.

I'll see if this issue happens again in the future.


Thanks,

Z

________________________________
From: Zen 98052 <[email protected]>
Sent: Thursday, July 14, 2016 9:40:03 AM
To: [email protected]
Subject: Re: finishRequest callback is not invoked

I don't know if startRequest was called or not, since I didn't write any log 
there, other than capturing the start time.


This is my code (the graphDataset is the subclass code I mentioned):


UpdateRequest request = UpdateFactory.read(stream, Syntax.syntaxARQ);
GraphStore graphStore = GraphStoreFactory.create(graphDataset);
UpdateProcessor updateProc = UpdateExecutionFactory.create(request, graphStore);

        if (updateProc == null) {
            throw new RuntimeException(
            "Failed to create update processor to execute update query: " + 
updateQuery);
        }

updateProc.execute();


The code above, UpdateExecuteFactory.create() will eventually call this code:


        UpdateEngineFactory f = UpdateEngineRegistry.get().find(graphStore, 
context) ;
        if ( f == null )
            return null ;

        UpdateProcessorBase uProc = new UpdateProcessorBase(updateRequest, 
graphStore, inputBinding, context, f) ;
        return uProc ;


So I am 99% sure it'll call that exact code in UpdateProcessorBase class.

Again, this code (and finishRequest is called) works fine 99.99%, but we have 
data lost when it's not working [:(]


If startRequest never got called, then that worries me even more [:(]

Do you see anything wrong with my implementation code above?


Note that my service is running on Jetty, so it can get multiple requests, but 
each request will have its own Graph dataset instance.



Thanks,

Z

________________________________
From: Andy Seaborne <[email protected]>
Sent: Thursday, July 14, 2016 8:59:04 AM
To: [email protected]
Subject: Re: finishRequest callback is not invoked

On 14/07/16 13:48, Zen 98052 wrote:
> Hi,
>
> I subclass DatasetGraphBase and implements GraphStore interface.
>
> The interface has method of startRequest and finishRequest.
>
> I don't bother startRequest, but I add code to call flush (to our back-end 
> store) in finishRequest.
>
> Yesterday we encountered same issue again, which finishRequest never be 
> called from Jena.
>
> I know that's the case because the debug info in that function not in the log.
>
> This is not easy to reproduce, and we only saw few times. Looking at the code 
> in UpdateProcessorBase.java:
>
>          uProc.startRequest();
>
>          try {
>              UpdateSink sink = uProc.getUpdateSink();
>              Iter.sendToSink(request, sink);     // Will call close on sink 
> if there are no exceptions
>          } finally {
>              uProc.finishRequest() ;
>          }
>
>
> I don't understand why finishRequest() will not be called. Any idea?

Is startRequest called?
Is uProc the right implementation?

     Andy

>
>
> Thanks,
>
> Z
>
>

Reply via email to