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

2016-09-27 Thread Andy Seaborne (JIRA)

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

Andy Seaborne resolved JENA-1237.
-
   Resolution: Fixed
 Assignee: Andy Seaborne  (was: A. Soroka)
Fix Version/s: Jena 3.1.1

> 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: Andy Seaborne
> Fix For: Jena 3.1.1
>
> 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 pull request #170: JENA-1223: Txn promotion for TIM (includes patch for...

2016-09-27 Thread asfgit
Github user asfgit closed the pull request at:

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


---
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.
---


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

2016-09-27 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on JENA-1237:
---

Commit cc2c4bd54c15b958dede6b4e83e6ee440a3157c8 in jena's branch 
refs/heads/master from [~andy.seaborne]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=cc2c4bd ]

JENA-1237: Capture transaction snapshot during begin.

> 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-1223) Provide transaction promotion

2016-09-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-1223:
--

Github user asfgit closed the pull request at:

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


> Provide transaction promotion
> -
>
> Key: JENA-1223
> URL: https://issues.apache.org/jira/browse/JENA-1223
> Project: Apache Jena
>  Issue Type: Improvement
>  Components: TDB
>Affects Versions: Jena 3.1.0
>Reporter: Andy Seaborne
>
> This JIRA is to add the ability for a read transaction to promote to a write 
> transaction.
> API changes are necessary to expose this feature properly and uniformly.
> PR #161 provides the machinery for TDB. To avoid general API changes outside 
> TDB, this happens automatically in {{DatasetGraphTransaction.getW()}} if 
> enabled (by default it isn't, the PR makes no change to behaviour of TDB by 
> default).  It needs to be enabled with {{DatasetGraphTransaction.promotion = 
> true}}. PR#161 does contain internal changes (e.g. {{DatasetGraphWrapper}}) 
> outside TDB.
> This leads towards a general {{begin()}} for transactions. 
> This JIRA is cover discussion on the API and record changes to the subsystems.



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


[jira] [Commented] (JENA-1223) Provide transaction promotion

2016-09-27 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on JENA-1223:
---

Commit 779e85cf4d66a0dcbfea41a657f262249c2d9f57 in jena's branch 
refs/heads/master from [~andy.seaborne]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=779e85c ]

JENA-1223: Incorporate review suggestions


> Provide transaction promotion
> -
>
> Key: JENA-1223
> URL: https://issues.apache.org/jira/browse/JENA-1223
> Project: Apache Jena
>  Issue Type: Improvement
>  Components: TDB
>Affects Versions: Jena 3.1.0
>Reporter: Andy Seaborne
>
> This JIRA is to add the ability for a read transaction to promote to a write 
> transaction.
> API changes are necessary to expose this feature properly and uniformly.
> PR #161 provides the machinery for TDB. To avoid general API changes outside 
> TDB, this happens automatically in {{DatasetGraphTransaction.getW()}} if 
> enabled (by default it isn't, the PR makes no change to behaviour of TDB by 
> default).  It needs to be enabled with {{DatasetGraphTransaction.promotion = 
> true}}. PR#161 does contain internal changes (e.g. {{DatasetGraphWrapper}}) 
> outside TDB.
> This leads towards a general {{begin()}} for transactions. 
> This JIRA is cover discussion on the API and record changes to the subsystems.



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


[jira] [Commented] (JENA-1223) Provide transaction promotion

2016-09-27 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on JENA-1223:
---

Commit fbb53efccb59cf6596e7c4601653d8eb0470f36d in jena's branch 
refs/heads/master from [~andy.seaborne]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=fbb53ef ]

JENA-1223: Merge commit 'refs/pull/170/head' of github.com:apache/jena

This closes #170.


> Provide transaction promotion
> -
>
> Key: JENA-1223
> URL: https://issues.apache.org/jira/browse/JENA-1223
> Project: Apache Jena
>  Issue Type: Improvement
>  Components: TDB
>Affects Versions: Jena 3.1.0
>Reporter: Andy Seaborne
>
> This JIRA is to add the ability for a read transaction to promote to a write 
> transaction.
> API changes are necessary to expose this feature properly and uniformly.
> PR #161 provides the machinery for TDB. To avoid general API changes outside 
> TDB, this happens automatically in {{DatasetGraphTransaction.getW()}} if 
> enabled (by default it isn't, the PR makes no change to behaviour of TDB by 
> default).  It needs to be enabled with {{DatasetGraphTransaction.promotion = 
> true}}. PR#161 does contain internal changes (e.g. {{DatasetGraphWrapper}}) 
> outside TDB.
> This leads towards a general {{begin()}} for transactions. 
> This JIRA is cover discussion on the API and record changes to the subsystems.



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


[jira] [Commented] (JENA-1223) Provide transaction promotion

2016-09-27 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on JENA-1223:
---

Commit 2610908744464e1247b2896f7b26e78cadf56d84 in jena's branch 
refs/heads/master from [~andy.seaborne]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=2610908 ]

JENA-1223: Transaction promotion for TIM


> Provide transaction promotion
> -
>
> Key: JENA-1223
> URL: https://issues.apache.org/jira/browse/JENA-1223
> Project: Apache Jena
>  Issue Type: Improvement
>  Components: TDB
>Affects Versions: Jena 3.1.0
>Reporter: Andy Seaborne
>
> This JIRA is to add the ability for a read transaction to promote to a write 
> transaction.
> API changes are necessary to expose this feature properly and uniformly.
> PR #161 provides the machinery for TDB. To avoid general API changes outside 
> TDB, this happens automatically in {{DatasetGraphTransaction.getW()}} if 
> enabled (by default it isn't, the PR makes no change to behaviour of TDB by 
> default).  It needs to be enabled with {{DatasetGraphTransaction.promotion = 
> true}}. PR#161 does contain internal changes (e.g. {{DatasetGraphWrapper}}) 
> outside TDB.
> This leads towards a general {{begin()}} for transactions. 
> This JIRA is cover discussion on the API and record changes to the subsystems.



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


[jira] [Commented] (JENA-1223) Provide transaction promotion

2016-09-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-1223:
--

Github user ajs6f commented on the issue:

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


> Provide transaction promotion
> -
>
> Key: JENA-1223
> URL: https://issues.apache.org/jira/browse/JENA-1223
> Project: Apache Jena
>  Issue Type: Improvement
>  Components: TDB
>Affects Versions: Jena 3.1.0
>Reporter: Andy Seaborne
>
> This JIRA is to add the ability for a read transaction to promote to a write 
> transaction.
> API changes are necessary to expose this feature properly and uniformly.
> PR #161 provides the machinery for TDB. To avoid general API changes outside 
> TDB, this happens automatically in {{DatasetGraphTransaction.getW()}} if 
> enabled (by default it isn't, the PR makes no change to behaviour of TDB by 
> default).  It needs to be enabled with {{DatasetGraphTransaction.promotion = 
> true}}. PR#161 does contain internal changes (e.g. {{DatasetGraphWrapper}}) 
> outside TDB.
> This leads towards a general {{begin()}} for transactions. 
> This JIRA is cover discussion on the API and record changes to the subsystems.



--
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-27 Thread ajs6f
Github user ajs6f commented on the issue:

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


---
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.
---


Re: HttpClient and authentication - preferred style?

2016-09-27 Thread A. Soroka
Yes, that is what we landed on. (Long discussion at 
https://github.com/apache/jena/pull/151)

I still owe Rob Vesse some examples of how to deal with form-authenticated 
SPARQL endpoints in that new style. Not as easy to find those as it used to be!

---
A. Soroka
The University of Virginia Library

> On Sep 27, 2016, at 9:49 AM, Andy Seaborne  wrote:
> 
> What was decided about the preferred style for authentication / HttpOp?
> 
> Was it calls with HttpClient + HttpContext?
> 
> I was getting RDF Connection [1] sorted out and reflecting the preferred 
> style we're aiming for HttpOp would be good.
> 
>   Andy
> 
> [1] https://github.com/afs/jena-rdfconnection
> Documentation:
> https://github.com/afs/jena-rdfconnection/blob/master/Documentation.md



[jira] [Commented] (JENA-1223) Provide transaction promotion

2016-09-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-1223:
--

Github user ajs6f commented on the issue:

https://github.com/apache/jena/pull/170
  
Sorry @afs -- I am not used to Github's new "review" mode. I made some 
comments a while ago, but apparently, I didn't press "Finish review" so you 
never saw them!


> Provide transaction promotion
> -
>
> Key: JENA-1223
> URL: https://issues.apache.org/jira/browse/JENA-1223
> Project: Apache Jena
>  Issue Type: Improvement
>  Components: TDB
>Affects Versions: Jena 3.1.0
>Reporter: Andy Seaborne
>
> This JIRA is to add the ability for a read transaction to promote to a write 
> transaction.
> API changes are necessary to expose this feature properly and uniformly.
> PR #161 provides the machinery for TDB. To avoid general API changes outside 
> TDB, this happens automatically in {{DatasetGraphTransaction.getW()}} if 
> enabled (by default it isn't, the PR makes no change to behaviour of TDB by 
> default).  It needs to be enabled with {{DatasetGraphTransaction.promotion = 
> true}}. PR#161 does contain internal changes (e.g. {{DatasetGraphWrapper}}) 
> outside TDB.
> This leads towards a general {{begin()}} for transactions. 
> This JIRA is cover discussion on the API and record changes to the subsystems.



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


[jira] [Commented] (JENA-1223) Provide transaction promotion

2016-09-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-1223:
--

Github user ajs6f commented on a diff in the pull request:

https://github.com/apache/jena/pull/170#discussion_r79304304
  
--- Diff: 
jena-arq/src/test/java/org/apache/jena/sparql/transaction/AbstractTestTransactionIsolation.java
 ---
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.sparql.transaction;
+
+import static org.apache.jena.query.ReadWrite.* ;
+
+import org.apache.jena.atlas.iterator.Iter ;
+import org.apache.jena.sparql.core.DatasetGraph ;
+import org.apache.jena.sparql.core.Quad ;
+import org.apache.jena.sparql.sse.SSE ;
+import org.apache.jena.system.ThreadAction ;
+import org.apache.jena.system.ThreadTxn ;
+import org.junit.Assert ;
+import org.junit.Test ;
+
+/** Isolation tests */
+public abstract class AbstractTestTransactionIsolation {
+
+protected abstract DatasetGraph create() ; 
+static Quad q1 = SSE.parseQuad("(_ :s :p 111)") ;
+
+@Test
+public void isolation_01() {
+// Start a read transaction on another thread.
+// The transaction has begin() by the time threadTxnRead
+// returns but the action of the ThreadTxn is not triggered
+// until other.run() is called.
+DatasetGraph dsg = create() ;
+ThreadAction other = ThreadTxn.threadTxnRead(dsg, ()-> {
+long x = Iter.count(dsg.find()) ;
+Assert.assertEquals(0, x) ;
--- End diff --

Maybe `ThreadAction other = ThreadTxn.threadTxnRead(dsg, () -> 
Assert.assertTrue(dsg.isEmpty()));` is a little clearer?


> Provide transaction promotion
> -
>
> Key: JENA-1223
> URL: https://issues.apache.org/jira/browse/JENA-1223
> Project: Apache Jena
>  Issue Type: Improvement
>  Components: TDB
>Affects Versions: Jena 3.1.0
>Reporter: Andy Seaborne
>
> This JIRA is to add the ability for a read transaction to promote to a write 
> transaction.
> API changes are necessary to expose this feature properly and uniformly.
> PR #161 provides the machinery for TDB. To avoid general API changes outside 
> TDB, this happens automatically in {{DatasetGraphTransaction.getW()}} if 
> enabled (by default it isn't, the PR makes no change to behaviour of TDB by 
> default).  It needs to be enabled with {{DatasetGraphTransaction.promotion = 
> true}}. PR#161 does contain internal changes (e.g. {{DatasetGraphWrapper}}) 
> outside TDB.
> This leads towards a general {{begin()}} for transactions. 
> This JIRA is cover discussion on the API and record changes to the subsystems.



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


[jira] [Commented] (JENA-1223) Provide transaction promotion

2016-09-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-1223:
--

Github user ajs6f commented on a diff in the pull request:

https://github.com/apache/jena/pull/170#discussion_r80697618
  
--- Diff: 
jena-arq/src/test/java/org/apache/jena/sparql/transaction/AbstractTestTransPromote.java
 ---
@@ -270,15 +281,30 @@ private void run_08(boolean b) {
 @Test
 public void promote_11() { promote_readCommit_txnCommit(true, false) ; 
}
 
-@Test(expected = TDBTransactionException.class)
-public void promote_12() { promote_readCommit_txnCommit(false, true) ; 
}
+@Test
+public void promote_12() { 
+expect(()->promote_readCommit_txnCommit(false, true) ,
+   getTransactionExceptionClass()) ;
+}
+
+private void expect(Runnable runnable, Class...classes) {
--- End diff --

This might be a pinch clearer as `... Class...classes) 
{`...


> Provide transaction promotion
> -
>
> Key: JENA-1223
> URL: https://issues.apache.org/jira/browse/JENA-1223
> Project: Apache Jena
>  Issue Type: Improvement
>  Components: TDB
>Affects Versions: Jena 3.1.0
>Reporter: Andy Seaborne
>
> This JIRA is to add the ability for a read transaction to promote to a write 
> transaction.
> API changes are necessary to expose this feature properly and uniformly.
> PR #161 provides the machinery for TDB. To avoid general API changes outside 
> TDB, this happens automatically in {{DatasetGraphTransaction.getW()}} if 
> enabled (by default it isn't, the PR makes no change to behaviour of TDB by 
> default).  It needs to be enabled with {{DatasetGraphTransaction.promotion = 
> true}}. PR#161 does contain internal changes (e.g. {{DatasetGraphWrapper}}) 
> outside TDB.
> This leads towards a general {{begin()}} for transactions. 
> This JIRA is cover discussion on the API and record changes to the subsystems.



--
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-27 Thread ajs6f
Github user ajs6f commented on the issue:

https://github.com/apache/jena/pull/170
  
Sorry @afs -- I am not used to Github's new "review" mode. I made some 
comments a while ago, but apparently, I didn't press "Finish review" so you 
never saw them!


---
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-27 Thread ajs6f
Github user ajs6f commented on a diff in the pull request:

https://github.com/apache/jena/pull/170#discussion_r79304304
  
--- Diff: 
jena-arq/src/test/java/org/apache/jena/sparql/transaction/AbstractTestTransactionIsolation.java
 ---
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.sparql.transaction;
+
+import static org.apache.jena.query.ReadWrite.* ;
+
+import org.apache.jena.atlas.iterator.Iter ;
+import org.apache.jena.sparql.core.DatasetGraph ;
+import org.apache.jena.sparql.core.Quad ;
+import org.apache.jena.sparql.sse.SSE ;
+import org.apache.jena.system.ThreadAction ;
+import org.apache.jena.system.ThreadTxn ;
+import org.junit.Assert ;
+import org.junit.Test ;
+
+/** Isolation tests */
+public abstract class AbstractTestTransactionIsolation {
+
+protected abstract DatasetGraph create() ; 
+static Quad q1 = SSE.parseQuad("(_ :s :p 111)") ;
+
+@Test
+public void isolation_01() {
+// Start a read transaction on another thread.
+// The transaction has begin() by the time threadTxnRead
+// returns but the action of the ThreadTxn is not triggered
+// until other.run() is called.
+DatasetGraph dsg = create() ;
+ThreadAction other = ThreadTxn.threadTxnRead(dsg, ()-> {
+long x = Iter.count(dsg.find()) ;
+Assert.assertEquals(0, x) ;
--- End diff --

Maybe `ThreadAction other = ThreadTxn.threadTxnRead(dsg, () -> 
Assert.assertTrue(dsg.isEmpty()));` is a little clearer?


---
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-27 Thread ajs6f
Github user ajs6f commented on a diff in the pull request:

https://github.com/apache/jena/pull/170#discussion_r80697618
  
--- Diff: 
jena-arq/src/test/java/org/apache/jena/sparql/transaction/AbstractTestTransPromote.java
 ---
@@ -270,15 +281,30 @@ private void run_08(boolean b) {
 @Test
 public void promote_11() { promote_readCommit_txnCommit(true, false) ; 
}
 
-@Test(expected = TDBTransactionException.class)
-public void promote_12() { promote_readCommit_txnCommit(false, true) ; 
}
+@Test
+public void promote_12() { 
+expect(()->promote_readCommit_txnCommit(false, true) ,
+   getTransactionExceptionClass()) ;
+}
+
+private void expect(Runnable runnable, Class...classes) {
--- End diff --

This might be a pinch clearer as `... Class...classes) 
{`...


---
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.
---


HttpClient and authentication - preferred style?

2016-09-27 Thread Andy Seaborne

What was decided about the preferred style for authentication / HttpOp?

Was it calls with HttpClient + HttpContext?

I was getting RDF Connection [1] sorted out and reflecting the preferred 
style we're aiming for HttpOp would be good.


Andy

[1] https://github.com/afs/jena-rdfconnection
Documentation:
https://github.com/afs/jena-rdfconnection/blob/master/Documentation.md


[GitHub] jena issue #171: Using library code in a few classes

2016-09-27 Thread ajs6f
Github user ajs6f commented on the issue:

https://github.com/apache/jena/pull/171
  
Yes, certainly I'll hold off-- I have no idea how I missed that, especially 
given that I just pointed out that JSON-LD PR to a colleague in a downstream 
project yesterday!


---
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 #171: Using library code in a few classes

2016-09-27 Thread ajs6f
Github user ajs6f commented on a diff in the pull request:

https://github.com/apache/jena/pull/171#discussion_r80686831
  
--- Diff: jena-arq/src/main/java/org/apache/jena/atlas/test/Gen.java ---
@@ -32,52 +38,35 @@
 return rand(numRand, low, high, false) ; 
 }
 
-/** Generate a random sequence between low (inclusive) and high 
(exclusive) - choose whether to have duplicates or not */ 
+/**
+ * Generate a random sequence between low (inclusive) and high 
(exclusive) - with duplicates or no
--- End diff --

Good catch.


---
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 #171: Using library code in a few classes

2016-09-27 Thread ajs6f
Github user ajs6f commented on a diff in the pull request:

https://github.com/apache/jena/pull/171#discussion_r80686815
  
--- Diff: jena-arq/src/main/java/org/apache/jena/atlas/test/Gen.java ---
@@ -95,19 +84,13 @@
 }
 if ( !found )
 System.err.printf("Corrupted permute: [%s] [%s]\n", 
strings(x), strings(x2)) ;
-}
+}*/
--- End diff --

Glad to!


---
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.
---


[jira] [Commented] (JENA-1223) Provide transaction promotion

2016-09-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-1223:
--

Github user afs commented on the issue:

https://github.com/apache/jena/pull/170
  
Is this good to go in the codebase?


> Provide transaction promotion
> -
>
> Key: JENA-1223
> URL: https://issues.apache.org/jira/browse/JENA-1223
> Project: Apache Jena
>  Issue Type: Improvement
>  Components: TDB
>Affects Versions: Jena 3.1.0
>Reporter: Andy Seaborne
>
> This JIRA is to add the ability for a read transaction to promote to a write 
> transaction.
> API changes are necessary to expose this feature properly and uniformly.
> PR #161 provides the machinery for TDB. To avoid general API changes outside 
> TDB, this happens automatically in {{DatasetGraphTransaction.getW()}} if 
> enabled (by default it isn't, the PR makes no change to behaviour of TDB by 
> default).  It needs to be enabled with {{DatasetGraphTransaction.promotion = 
> true}}. PR#161 does contain internal changes (e.g. {{DatasetGraphWrapper}}) 
> outside TDB.
> This leads towards a general {{begin()}} for transactions. 
> This JIRA is cover discussion on the API and record changes to the subsystems.



--
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-27 Thread afs
Github user afs commented on the issue:

https://github.com/apache/jena/pull/170
  
Is this good to go in the codebase?


---
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.
---