Re: [Neo4j] REST Batch: failed to insert empty array as a node property

2011-07-18 Thread Jacob Hansson
On Wed, Jul 6, 2011 at 7:55 AM, Igor Dovgiy ivd.cu...@gmail.com wrote:

 When trying to process POSTing to batch-path of something like...

 [{id:1,
  method:POST,
  to:/node,
  body:{user_properties:[]}
 }]

 ...server fails with...
  exception : java.lang.RuntimeException,
  stacktrace : [

 org.neo4j.server.rest.web.BatchOperationService.performJob(BatchOperationService.java:137),

 org.neo4j.server.rest.web.BatchOperationService.performBatchOperations(BatchOperationService.java:83),
 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method),
 sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source),
 sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source),
 java.lang.reflect.Method.invoke(Unknown Source) etc.

 A bug, or have I missed something in Neo4j docs?


This is actually expected behaviour. The server cannot use an empty array to
set a property, because it doesn't know what type of array it is (and the
database requires typed arrays).

It does uncover two issues though - one is that the error reporting in the
batch API does not relay the underlying errors very well at all, I'll fix
that.

The other is that I think the expected behavior here should change. Empty
arrays shouldn't be a special case, in my opinion, and it would be easy for
us to just default to an empty boolean array or something.

/jake


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




-- 
Jacob Hansson
Phone: +46 (0) 763503395
Twitter: @jakewins
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] REST Batch: failed to insert empty array as a node property

2011-07-18 Thread Jacob Hansson
On Mon, Jul 18, 2011 at 5:39 PM, Mattias Persson
matt...@neotechnology.comwrote:

 2011/7/18 Jacob Hansson ja...@voltvoodoo.com

  On Wed, Jul 6, 2011 at 7:55 AM, Igor Dovgiy ivd.cu...@gmail.com wrote:
 
   When trying to process POSTing to batch-path of something like...
  
   [{id:1,
method:POST,
to:/node,
body:{user_properties:[]}
   }]
  
   ...server fails with...
exception : java.lang.RuntimeException,
stacktrace : [
  
  
 
 org.neo4j.server.rest.web.BatchOperationService.performJob(BatchOperationService.java:137),
  
  
 
 org.neo4j.server.rest.web.BatchOperationService.performBatchOperations(BatchOperationService.java:83),
   sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method),
   sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source),
   sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source),
   java.lang.reflect.Method.invoke(Unknown Source) etc.
  
   A bug, or have I missed something in Neo4j docs?
  
 
  This is actually expected behaviour. The server cannot use an empty array
  to
  set a property, because it doesn't know what type of array it is (and the
  database requires typed arrays).
 
  It does uncover two issues though - one is that the error reporting in
 the
  batch API does not relay the underlying errors very well at all, I'll fix
  that.
 
  The other is that I think the expected behavior here should change. Empty
  arrays shouldn't be a special case, in my opinion, and it would be easy
 for
  us to just default to an empty boolean array or something.
 
 You mean storing an empty boolean[] on the entity? It could possibly work
 in a REST environment, but not embedded where if you added an empty int[]
 you'd get back a boolean[] all of a sudden.


Oh snap, my head was all full of REST, you are absolutely right.



  /jake
 
 
   ___
   Neo4j mailing list
   User@lists.neo4j.org
   https://lists.neo4j.org/mailman/listinfo/user
  
 
 
 
  --
  Jacob Hansson
  Phone: +46 (0) 763503395
  Twitter: @jakewins
  ___
  Neo4j mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user
 



 --
 Mattias Persson, [matt...@neotechnology.com]
 Hacker, Neo Technology
 www.neotechnology.com
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




-- 
Jacob Hansson
Phone: +46 (0) 763503395
Twitter: @jakewins
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] REST Batch: failed to insert empty array as a node property

2011-07-06 Thread Igor Dovgiy
When trying to process POSTing to batch-path of something like...

[{id:1,
 method:POST,
  to:/node,
  body:{user_properties:[]}
}]

...server fails with...
  exception : java.lang.RuntimeException,
  stacktrace : [
org.neo4j.server.rest.web.BatchOperationService.performJob(BatchOperationService.java:137),
org.neo4j.server.rest.web.BatchOperationService.performBatchOperations(BatchOperationService.java:83),
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method),
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source),
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source),
java.lang.reflect.Method.invoke(Unknown Source) etc.

A bug, or have I missed something in Neo4j docs?
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user