Hello,
Newbie question: I got an exception for this code:

public final String getNotes () {
if (underlyingNode != null)
return (String) underlyingNode.getProperty(Constants.PERSON_NOTES, null);
else
return null;
}

I would expect this code can handle the retrieving of the Notes property 
correctly, whether there is a such property or not. But this is the exception I 
saw:
---------
Exception in thread "AWT-EventQueue-0" 
org.neo4j.graphdb.NotInTransactionException: No transaction found for current 
thread
at 
org.neo4j.kernel.impl.persistence.PersistenceManager.getCurrentTransaction(PersistenceManager.java:232)
at 
org.neo4j.kernel.impl.persistence.PersistenceManager.getReadOnlyResource(PersistenceManager.java:179)
at 
org.neo4j.kernel.impl.persistence.PersistenceManager.loadPropertyValue(PersistenceManager.java:72)
at 
org.neo4j.kernel.impl.core.NodeManager.loadPropertyValue(NodeManager.java:572)
at 
org.neo4j.kernel.impl.core.NeoPrimitive.getPropertyValue(NeoPrimitive.java:538)
at org.neo4j.kernel.impl.core.NeoPrimitive.getProperty(NeoPrimitive.java:259)
at org.neo4j.kernel.impl.core.NodeProxy.getProperty(NodeProxy.java:113)
at com.metaverse.model.Person.getNotes(Person.java:96)
--------

This is how I retrieve the Person node:

public Person getPersonByName (String name) {
Person person = null;
if (name != null && name.length()>0) {
Transaction tx = graphDb.beginTx();
try {
IndexHits<Node> hits = indexService.getNodes(Constants.NODE_TYPE, 
Constants.PERSON_NODE);
if (hits != null && hits.size()>0) {
for (Node hit : hits) {
if (((String)hit.getProperty(Constants.PERSON_NAME)).equals(name)) {
person = new Person (hit);
break;
}
}
}
} finally {
tx.finish();
}
}
return person;
}
---------------

Anything wrong ? 

Appreciate any advice!
 rgds,
canal



      
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to