[jira] [Comment Edited] (JENA-1237) TIM not isolating transactions at the start

2016-09-17 Thread Andy Seaborne (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15499141#comment-15499141
 ] 

Andy Seaborne edited comment on JENA-1237 at 9/17/16 5:25 PM:
--

I discovered this while implementation transaction promotion for TIM. There 
will be a PR, and like current TDB it is off unless enabled while everything 
else gets aligned (so not for 3.1.1).  Code works, test work, needs to be 
turned into PR. Again, one that needs careful review before incorporating. It 
includes a generalized {{TestTransPromotion}} (which is for TDB) which is how I 
found this so it gets tested that way.

If you agree that this is the cause, something that needs careful review (just 
making things work is not good enough for concurrency!), I can fix this and put 
in a test case.



was (Author: andy.seaborne):
I discovered this while implementation transaction promotion for TIM. There 
will be a PR, and like current TDB it is off unless enabled while everything 
else gets aligned (so not for 3.1.1).  Code works, test work, needs to be 
turned into PR. Again, one that needs careful review before incorporating. It 
includes a generalized {{TestTramsPromotion}} (which is for TDB) which is how I 
found this so it gets tested that way.

If you agree that this is the cause, something that needs careful review (just 
making things work is not good enough for concurrency!), I can fix this and put 
in a test case.


> TIM not isolating transactions at the start
> ---
>
> Key: JENA-1237
> URL: https://issues.apache.org/jira/browse/JENA-1237
> Project: Apache Jena
>  Issue Type: Bug
>Affects Versions: Jena 3.1.0
>Reporter: Andy Seaborne
>Assignee: A. Soroka
> Attachments: ReportTxn.java
>
>
> TIM is not creating the transaction isolation when {{begin(READ)}} is called 
> but on the first operation.
> The attached example has two other-thread actions that differ only in whether 
> the begin is followed by a dataset read action (thread 2) or not (thread 1).  
> This changes the output of otherwise identical actions.
> {{ThreadAction}} takes 3 parts - the first part executes before the 
> {{create}} returns, the second part when {{run}} is called and exceptions 
> captured, the 3rd part is clearup (called during {{run}}).
> Annotated output from the attached program:
> {noformat}
> DatasetGraphInMemory
> thread 1:1 : x=
> Main   : other1
> thread 2:1 : x=0
> Main   : other2
> Main 1 : x=0
> Main 2 : x=1
> thread 1:2 : x=1  ** Should be zero **
> thread 2:2 : x=0
> TDBDataset
> thread 1:1 : x=
> Main   : other1
> thread 2:1 : x=0
> Main   : other2
> Main 1 : x=0
> Main 2 : x=1
> thread 1:2 : x=0  ** Correctly zero **
> thread 2:2 : x=0
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-1237) TIM not isolating transactions at the start

2016-09-17 Thread Andy Seaborne (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15499377#comment-15499377
 ] 

Andy Seaborne commented on JENA-1237:
-

Turns out it is better to send in the fix for this as PR #170; this can be 
reviewed now.

I'll follow it with the promotion code on that PR; the tests for the promotion 
code depend on this fix.


> TIM not isolating transactions at the start
> ---
>
> Key: JENA-1237
> URL: https://issues.apache.org/jira/browse/JENA-1237
> Project: Apache Jena
>  Issue Type: Bug
>Affects Versions: Jena 3.1.0
>Reporter: Andy Seaborne
>Assignee: A. Soroka
> Attachments: ReportTxn.java
>
>
> TIM is not creating the transaction isolation when {{begin(READ)}} is called 
> but on the first operation.
> The attached example has two other-thread actions that differ only in whether 
> the begin is followed by a dataset read action (thread 2) or not (thread 1).  
> This changes the output of otherwise identical actions.
> {{ThreadAction}} takes 3 parts - the first part executes before the 
> {{create}} returns, the second part when {{run}} is called and exceptions 
> captured, the 3rd part is clearup (called during {{run}}).
> Annotated output from the attached program:
> {noformat}
> DatasetGraphInMemory
> thread 1:1 : x=
> Main   : other1
> thread 2:1 : x=0
> Main   : other2
> Main 1 : x=0
> Main 2 : x=1
> thread 1:2 : x=1  ** Should be zero **
> thread 2:2 : x=0
> TDBDataset
> thread 1:1 : x=
> Main   : other1
> thread 2:1 : x=0
> Main   : other2
> Main 1 : x=0
> Main 2 : x=1
> thread 1:2 : x=0  ** Correctly zero **
> thread 2:2 : x=0
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] jena issue #170: JENA-1223: Txn promotion for TIM (includes patch for JENA-1...

2016-09-17 Thread afs
Github user afs commented on the issue:

https://github.com/apache/jena/pull/170
  
This first part of the PR is for JENA-1237.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] jena pull request #170: JENA-1223: Txn promotion for TIM (includes patch for...

2016-09-17 Thread afs
GitHub user afs opened a pull request:

https://github.com/apache/jena/pull/170

JENA-1223: Txn promotion for TIM (includes patch for JENA-1237)

Machinery for transaction promotion for the in-memory transactional dataset.


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/afs/jena promote-mem

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/jena/pull/170.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #170


commit cc2c4bd54c15b958dede6b4e83e6ee440a3157c8
Author: Andy Seaborne 
Date:   2016-09-17T15:51:25Z

JENA-1237: Capture transaction snapshot during begin.

commit f9f2870e29fd1ac51c49740a42f6fbb644b7616d
Author: Andy Seaborne 
Date:   2016-09-17T16:02:50Z

Clean up.

commit 51175d27768955ed1918b79ea7f046723e5c3173
Author: Andy Seaborne 
Date:   2016-09-17T16:03:31Z

JENA-1237: Tests (TDB and TIM)




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


jena.zones.apache.org -> jena-vm.apache.org

2016-09-17 Thread Andy Seaborne
sparql.org has been running in an Apache Infra FreeBSD jail for some 
time.  But FreeBSD is not very up to date with Java and anyway Infra and 
moving to Ubuntu-based VMs for the project servers.


Infra has kindly provided and setup a new platform with an Ubuntu VM Java8.

At the moment, sparql.org is running old Fuseki code. I'll get round to 
updating it to the current, java8-requiring, version.


Andy

INFRA-1


[jira] [Commented] (JENA-1237) TIM not isolating transactions at the start

2016-09-17 Thread A. Soroka (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15499148#comment-15499148
 ] 

A. Soroka commented on JENA-1237:
-

I'm totally fine with you acting on this, especially if it is blocking anything 
of yours-- as I said, I won't be able to do much before Monday.

> TIM not isolating transactions at the start
> ---
>
> Key: JENA-1237
> URL: https://issues.apache.org/jira/browse/JENA-1237
> Project: Apache Jena
>  Issue Type: Bug
>Affects Versions: Jena 3.1.0
>Reporter: Andy Seaborne
>Assignee: A. Soroka
> Attachments: ReportTxn.java
>
>
> TIM is not creating the transaction isolation when {{begin(READ)}} is called 
> but on the first operation.
> The attached example has two other-thread actions that differ only in whether 
> the begin is followed by a dataset read action (thread 2) or not (thread 1).  
> This changes the output of otherwise identical actions.
> {{ThreadAction}} takes 3 parts - the first part executes before the 
> {{create}} returns, the second part when {{run}} is called and exceptions 
> captured, the 3rd part is clearup (called during {{run}}).
> Annotated output from the attached program:
> {noformat}
> DatasetGraphInMemory
> thread 1:1 : x=
> Main   : other1
> thread 2:1 : x=0
> Main   : other2
> Main 1 : x=0
> Main 2 : x=1
> thread 1:2 : x=1  ** Should be zero **
> thread 2:2 : x=0
> TDBDataset
> thread 1:1 : x=
> Main   : other1
> thread 2:1 : x=0
> Main   : other2
> Main 1 : x=0
> Main 2 : x=1
> thread 1:2 : x=0  ** Correctly zero **
> thread 2:2 : x=0
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Assigned] (JENA-1237) TIM not isolating transactions at the start

2016-09-17 Thread A. Soroka (JIRA)

 [ 
https://issues.apache.org/jira/browse/JENA-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

A. Soroka reassigned JENA-1237:
---

Assignee: A. Soroka

> TIM not isolating transactions at the start
> ---
>
> Key: JENA-1237
> URL: https://issues.apache.org/jira/browse/JENA-1237
> Project: Apache Jena
>  Issue Type: Bug
>Affects Versions: Jena 3.1.0
>Reporter: Andy Seaborne
>Assignee: A. Soroka
> Attachments: ReportTxn.java
>
>
> TIM is not creating the transaction isolation when {{begin(READ)}} is called 
> but on the first operation.
> The attached example has two other-thread actions that differ only in whether 
> the begin is followed by a dataset read action (thread 2) or not (thread 1).  
> This changes the output of otherwise identical actions.
> {{ThreadAction}} takes 3 parts - the first part executes before the 
> {{create}} returns, the second part when {{run}} is called and exceptions 
> captured, the 3rd part is clearup (called during {{run}}).
> Annotated output from the attached program:
> {noformat}
> DatasetGraphInMemory
> thread 1:1 : x=
> Main   : other1
> thread 2:1 : x=0
> Main   : other2
> Main 1 : x=0
> Main 2 : x=1
> thread 1:2 : x=1  ** Should be zero **
> thread 2:2 : x=0
> TDBDataset
> thread 1:1 : x=
> Main   : other1
> thread 2:1 : x=0
> Main   : other2
> Main 1 : x=0
> Main 2 : x=1
> thread 1:2 : x=0  ** Correctly zero **
> thread 2:2 : x=0
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-1237) TIM not isolating transactions at the start

2016-09-17 Thread A. Soroka (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15499066#comment-15499066
 ] 

A. Soroka commented on JENA-1237:
-

This sounds extremely plausible. I should be able to take a look at this 
Monday, and if this _is_ the cause, it should be a pretty simple fix and test 
commit.

> TIM not isolating transactions at the start
> ---
>
> Key: JENA-1237
> URL: https://issues.apache.org/jira/browse/JENA-1237
> Project: Apache Jena
>  Issue Type: Bug
>Affects Versions: Jena 3.1.0
>Reporter: Andy Seaborne
> Attachments: ReportTxn.java
>
>
> TIM is not creating the transaction isolation when {{begin(READ)}} is called 
> but on the first operation.
> The attached example has two other-thread actions that differ only in whether 
> the begin is followed by a dataset read action (thread 2) or not (thread 1).  
> This changes the output of otherwise identical actions.
> {{ThreadAction}} takes 3 parts - the first part executes before the 
> {{create}} returns, the second part when {{run}} is called and exceptions 
> captured, the 3rd part is clearup (called during {{run}}).
> Annotated output from the attached program:
> {noformat}
> DatasetGraphInMemory
> thread 1:1 : x=
> Main   : other1
> thread 2:1 : x=0
> Main   : other2
> Main 1 : x=0
> Main 2 : x=1
> thread 1:2 : x=1  ** Should be zero **
> thread 2:2 : x=0
> TDBDataset
> thread 1:1 : x=
> Main   : other1
> thread 2:1 : x=0
> Main   : other2
> Main 1 : x=0
> Main 2 : x=1
> thread 1:2 : x=0  ** Correctly zero **
> thread 2:2 : x=0
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-1237) TIM not isolating transactions at the start

2016-09-17 Thread Andy Seaborne (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15499060#comment-15499060
 ] 

Andy Seaborne commented on JENA-1237:
-

Possible cause:

{{PMapTupleTable.begin}} is a no-op method.  It does not touch the ThreadLocal 
"local" so that is not initialized and it is the ThreadLocal's withInitialthat 
sets the ThreadLocal.

If this is the cause, the fix is to initialize the thread local to null and set 
in {{begin}}.

{noformat}
ThreadLocal local = withInitial(() -> null);
...
public void begin(final ReadWrite rw) {
local.set(master().get());
}
{noformat}

> TIM not isolating transactions at the start
> ---
>
> Key: JENA-1237
> URL: https://issues.apache.org/jira/browse/JENA-1237
> Project: Apache Jena
>  Issue Type: Bug
>Affects Versions: Jena 3.1.0
>Reporter: Andy Seaborne
> Attachments: ReportTxn.java
>
>
> TIM is not creating the transaction isolation when {{begin(READ)}} is called 
> but on the first operation.
> The attached example has two other-thread actions that differ only in whether 
> the begin is followed by a dataset read action (thread 2) or not (thread 1).  
> This changes the output of otherwise identical actions.
> {{ThreadAction}} takes 3 parts - the first part executes before the 
> {{create}} returns, the second part when {{run}} is called and exceptions 
> captured, the 3rd part is clearup (called during {{run}}).
> Annotated output from the attached program:
> {noformat}
> DatasetGraphInMemory
> thread 1:1 : x=
> Main   : other1
> thread 2:1 : x=0
> Main   : other2
> Main 1 : x=0
> Main 2 : x=1
> thread 1:2 : x=1  ** Should be zero **
> thread 2:2 : x=0
> TDBDataset
> thread 1:1 : x=
> Main   : other1
> thread 2:1 : x=0
> Main   : other2
> Main 1 : x=0
> Main 2 : x=1
> thread 1:2 : x=0  ** Correctly zero **
> thread 2:2 : x=0
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (JENA-1237) TIM not isolating trasnactions at the start

2016-09-17 Thread Andy Seaborne (JIRA)
Andy Seaborne created JENA-1237:
---

 Summary: TIM not isolating trasnactions at the start
 Key: JENA-1237
 URL: https://issues.apache.org/jira/browse/JENA-1237
 Project: Apache Jena
  Issue Type: Bug
Affects Versions: Jena 3.1.0
Reporter: Andy Seaborne
 Attachments: ReportTxn.java

TIM is not creating the transaction isolation when {{begin(READ)}} is called 
but on the first operation.

The attached example has two other-thread actions that differ only in whether 
the begin is followed by a dataset read action (thread 2) or not (thread 1).  
This changes the output of otherwise identical actions.

{{ThreadAction}} takes 3 parts - the first part executes before the {{create}} 
returns, the second part when {{run}} is called and exceptions captured, the 
3rd part is clearup (called during {{run}}).

Annotated output from the attached program:

{noformat}
DatasetGraphInMemory
thread 1:1 : x=
Main   : other1
thread 2:1 : x=0
Main   : other2
Main 1 : x=0
Main 2 : x=1
thread 1:2 : x=1  ** Should be zero **
thread 2:2 : x=0

TDBDataset
thread 1:1 : x=
Main   : other1
thread 2:1 : x=0
Main   : other2
Main 1 : x=0
Main 2 : x=1
thread 1:2 : x=0  ** Correctly zero **
thread 2:2 : x=0
{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (JENA-1237) TIM not isolating transactions at the start

2016-09-17 Thread Andy Seaborne (JIRA)

 [ 
https://issues.apache.org/jira/browse/JENA-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andy Seaborne updated JENA-1237:

Summary: TIM not isolating transactions at the start  (was: TIM not 
isolating trasnactions at the start)

> TIM not isolating transactions at the start
> ---
>
> Key: JENA-1237
> URL: https://issues.apache.org/jira/browse/JENA-1237
> Project: Apache Jena
>  Issue Type: Bug
>Affects Versions: Jena 3.1.0
>Reporter: Andy Seaborne
> Attachments: ReportTxn.java
>
>
> TIM is not creating the transaction isolation when {{begin(READ)}} is called 
> but on the first operation.
> The attached example has two other-thread actions that differ only in whether 
> the begin is followed by a dataset read action (thread 2) or not (thread 1).  
> This changes the output of otherwise identical actions.
> {{ThreadAction}} takes 3 parts - the first part executes before the 
> {{create}} returns, the second part when {{run}} is called and exceptions 
> captured, the 3rd part is clearup (called during {{run}}).
> Annotated output from the attached program:
> {noformat}
> DatasetGraphInMemory
> thread 1:1 : x=
> Main   : other1
> thread 2:1 : x=0
> Main   : other2
> Main 1 : x=0
> Main 2 : x=1
> thread 1:2 : x=1  ** Should be zero **
> thread 2:2 : x=0
> TDBDataset
> thread 1:1 : x=
> Main   : other1
> thread 2:1 : x=0
> Main   : other2
> Main 1 : x=0
> Main 2 : x=1
> thread 1:2 : x=0  ** Correctly zero **
> thread 2:2 : x=0
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-1232) Node toString() method doesn't take into account the prefix mapping for literals

2016-09-17 Thread JIRA

[ 
https://issues.apache.org/jira/browse/JENA-1232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15498761#comment-15498761
 ] 

Lorenz Bühmann commented on JENA-1232:
--

Ah sorry, sure you can close it and I fully understand the concept behind it 
now. Using`FmtUtils` works perfectly, thanks!

> Node toString() method doesn't take into account the prefix mapping for 
> literals
> 
>
> Key: JENA-1232
> URL: https://issues.apache.org/jira/browse/JENA-1232
> Project: Apache Jena
>  Issue Type: Bug
>  Components: Base
>Affects Versions: Jena 3.1.0
>Reporter: Lorenz Bühmann
>Priority: Trivial
>
> Hi,
> not sure whether this is really a (very minor) bug or just a decision by 
> design, but what I discovered during using the graph layer of Jena was the 
> following:
> The class org.apache.jena.graph.Node provides some toString() methods, among 
> others, one which allows to add a PrefixMapping as argument
> This is then taken into account for rendering the object, e.g. to provide a 
> prefixed form of a URI. But I have recognized now that this doesn't work for 
> literals, e.g.
> "1"^^
> is never shortened to
> "1"^^xsd:int
> When looking into the code, I saw that in the class  
> org.apache.jena.graph.Node_Literal the prefix mapping is just ignored then 
> [1], probably because it's delegated to a method of the class LiteralLabel 
> which doesn't seem to have any method that uses prefix mappings.
> I know that this basically affects the core API, so probably this wasn't 
> designed for 3rd party use and extensions - in that case, simply close this 
> issue and I will continue with my current workaround.
> [1] 
> https://github.com/apache/jena/blob/master/jena-core/src/main/java/org/apache/jena/graph/Node_Literal.java#L67



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)