Hi,
A while ago I've asked a question about two tdb instances using same data files 
(see below).
Now I'm using the following code to open a model on both instances:
            SystemTDB.setFileMode(FileMode.direct);
            TDBMaker.setImplFactory(TDBMaker.uncachedFactory);
            model = TDBFactory.createModel(shared_location);

The problem is that sometimes when I do some changes on one instance - they are 
seen in another instance and sometimes are not.
So I have two questions -
1. How it is possible when I do not use any cache?
2. Is there any way to solve this problem?

Thank you,
Alex


-----Original Message-----
From: Alex Shapiro [mailto:[email protected]] 
Sent: Monday, March 11, 2013 16:58
To: '[email protected]'
Subject: RE: Two tdb instances using same data files

Thank you, Andy! 
I will try this.

Alex

-----Original Message-----
From: Andy Seaborne [mailto:[email protected]] On Behalf Of Andy 
Seaborne
Sent: Monday, March 11, 2013 15:46
To: [email protected]
Subject: Re: Two tdb instances using same data files

On 11/03/13 11:29, Alex Shapiro wrote:
> Thank you Marco and Andy! I perfectly understand that changes made in 
> one JVM will not update the model in second JVM and that this is in 
> general a bad idea :-). We are working on changing the architecture of 
> our application. Meanwhile, let's say I know when the update is done 
> in one JVM and can notify second JVM about the change - will it help 
> to close the model in second JVM and reopen it or reset the model 
> somehow to get the changes made in first JVM?
>
> Alex

"bad idea" is an understatement!

This might work:

Close the dataset and force it out of the dataset cache. 
TDBMaker.releaseDataset

But it's probably better to uncached datasets in the first place:

TDBMake.setImplFactory(TDBMaker.uncachedFactory)

No guarantees whatsoever.

        Andy



Reply via email to