You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by afs <gi...@git.apache.org> on 2018/02/15 15:41:34 UTC

[GitHub] jena pull request #361: Small improvements

GitHub user afs opened a pull request:

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

    Small improvements

    1. Yet another check for JENA-1482
    2. Put some cut-and-paste internal code as compiled java so it stay up to date.
    
    The (2) code is because Jena does not do multiple inheritance.


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

    $ git pull https://github.com/afs/jena small-things

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

    https://github.com/apache/jena/pull/361.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 #361
    
----
commit 30d2d87507ebad6d968731ca7f67aa4c8138edf3
Author: Andy Seaborne <an...@...>
Date:   2018-02-15T13:42:08Z

    JENA-1482: Check when mapping NodeId to Node

commit 634cced9f83fefa826c2f7bf893b0e05214d5962
Author: Andy Seaborne <an...@...>
Date:   2018-02-15T13:42:52Z

    Put usage examples into the code so they stay up-to-date.

----


---

[GitHub] jena pull request #361: Small improvements

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---

[GitHub] jena pull request #361: Small improvements

Posted by ajs6f <gi...@git.apache.org>.
Github user ajs6f commented on a diff in the pull request:

    https://github.com/apache/jena/pull/361#discussion_r168644094
  
    --- Diff: jena-tdb/src/main/java/org/apache/jena/tdb/solver/BindingTDB.java ---
    @@ -120,6 +121,8 @@ public Node get1(Var var)
                 if ( id == null )
                     return null ; 
                 n = nodeTable.getNodeForNodeId(id) ;
    +            if ( n == null )
    +                throw new TDBException("No node in NodeTable for NodeId "+id);
    --- End diff --
    
    Right-o, sounds like it's much better to leave it be.


---

[GitHub] jena pull request #361: Small improvements

Posted by afs <gi...@git.apache.org>.
Github user afs commented on a diff in the pull request:

    https://github.com/apache/jena/pull/361#discussion_r168597752
  
    --- Diff: jena-tdb/src/main/java/org/apache/jena/tdb/solver/BindingTDB.java ---
    @@ -120,6 +121,8 @@ public Node get1(Var var)
                 if ( id == null )
                     return null ; 
                 n = nodeTable.getNodeForNodeId(id) ;
    +            if ( n == null )
    +                throw new TDBException("No node in NodeTable for NodeId "+id);
    --- End diff --
    
    I don't know all the reasons for getting it.  The use  reports don't tend to tell us when things are fixed so I don't for sure whether my suggestions were of any help.
    
    One possible case is early exit, non-transactional use of TDB so the triple or quad table has written back (by natural OS managed file caching) but the NodeTable has not.  Exit without sync (not necessarily a crash) and they are out of step.
    
    Maybe with this we'll get better information and be able to refine it - at the moment, coudl well be a false trail.


---

[GitHub] jena pull request #361: Small improvements

Posted by ajs6f <gi...@git.apache.org>.
Github user ajs6f commented on a diff in the pull request:

    https://github.com/apache/jena/pull/361#discussion_r168523058
  
    --- Diff: jena-tdb/src/main/java/org/apache/jena/tdb/solver/BindingTDB.java ---
    @@ -120,6 +121,8 @@ public Node get1(Var var)
                 if ( id == null )
                     return null ; 
                 n = nodeTable.getNodeForNodeId(id) ;
    +            if ( n == null )
    +                throw new TDBException("No node in NodeTable for NodeId "+id);
    --- End diff --
    
    Do we know all/most of the circumstances that might cause this? Is it basically an interrupted write? If so, it might be worth including some error logging with that hint, but if there are more than one or two potential causes, never mind. I mention it because getting from "a missing entry in the `NodeTable`" to "that was the aftereffect of a failed write" is going to bring some users to the list when they might be able to figure out what happened with a simple hint.


---