Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete vertex and update queries not working in OSQLNonBlockingQuery #6946

Closed
1 task
temilmg opened this issue Nov 24, 2016 · 3 comments
Closed
1 task

Delete vertex and update queries not working in OSQLNonBlockingQuery #6946

temilmg opened this issue Nov 24, 2016 · 3 comments
Assignees
Labels
Milestone

Comments

@temilmg
Copy link

temilmg commented Nov 24, 2016

OrientDB Version, operating system, or hardware.

  • v2.2.13

Operating System

  • Linux

Expected behavior and actual behavior

When running code for delete vertex the data is deleted in the db correctly but the response is throwing an exception (see below) and also the 'void end()' method is called twice and the 'boolean result(Object iRecord)' method is not called.

The same is happening when doing an update query.

In end()
In end()
Exception in thread "Thread-3" com.orientechnologies.orient.enterprise.channel.binary.OResponseProcessingException: Exception during response processing
at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.throwSerializedException(OChannelBinaryAsynchClient.java:453)
at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.handleStatus(OChannelBinaryAsynchClient.java:388)
at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:270)
at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:162)
at com.orientechnologies.orient.client.remote.OStorageRemote.beginResponse(OStorageRemote.java:2167)
at com.orientechnologies.orient.client.remote.OStorageRemote$27.execute(OStorageRemote.java:1160)
at com.orientechnologies.orient.client.remote.OStorageRemote$2.execute(OStorageRemote.java:196)
at com.orientechnologies.orient.client.remote.OStorageRemote.baseNetworkOperation(OStorageRemote.java:235)
at com.orientechnologies.orient.client.remote.OStorageRemote.networkOperationRetry(OStorageRemote.java:193)
at com.orientechnologies.orient.client.remote.OStorageRemote.networkOperation(OStorageRemote.java:204)
at com.orientechnologies.orient.client.remote.OStorageRemote.command(OStorageRemote.java:1136)
at com.orientechnologies.orient.core.sql.query.OSQLQuery.run(OSQLQuery.java:78)
at com.orientechnologies.orient.core.sql.query.OSQLAsynchQuery.run(OSQLAsynchQuery.java:74)
at com.orientechnologies.orient.core.query.OQueryAbstract.execute(OQueryAbstract.java:33)
at com.yodenote.common.server.db.OSQLNonBlockingQuery2$1.run(OSQLNonBlockingQuery.java:284)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.util.List
at com.orientechnologies.orient.core.sql.query.OSQLQuery.run(OSQLQuery.java:78)
at com.orientechnologies.orient.core.sql.query.OSQLAsynchQuery.run(OSQLAsynchQuery.java:74)
at com.orientechnologies.orient.core.query.OQueryAbstract.execute(OQueryAbstract.java:33)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.command(ONetworkProtocolBinary.java:1446)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.executeRequest(ONetworkProtocolBinary.java:577)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.sessionRequest(ONetworkProtocolBinary.java:322)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.execute(ONetworkProtocolBinary.java:198)
at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:77)

Steps to reproduce the problem

		OrientGraph database = new OrientGraph(DBUtil.CONNECTION_URL + "mxi2");
//	    database.createVertexType("Prod").createProperty("something", OType.STRING);
//	    for (int i = 0; i < 21; i++) {
//	      OrientVertex vertex = database.addVertex("class:Prod");
//	      vertex.setProperty("something", "value");
//	      vertex.save();
//	    }
//	    database.commit();
	    try {
	      OSQLNonBlockingQuery<Object> test = new OSQLNonBlockingQuery<Object>("Delete vertex Prod limit 1", new OCommandResultListener() {
	        int resultCount = 0;

	        @Override
	        public boolean result(Object iRecord) {
	          resultCount++;

	          System.out.println("In result()");
	          
	          return resultCount > 1 ? false : true;
	        }

	        @Override
	        public void end() {
	        	System.out.println("In end()");
	        }

	        @Override
	        public Object getResult() {
	          return resultCount;
	        }
	      });
	      database.command(test).execute();

@temilmg
Copy link
Author

temilmg commented Nov 24, 2016

Sorry, I think I should clarify that I'm using version 2.2.13 but with the fix from the issue #6267

@luigidellaquila
Copy link
Member

The problem seems to be in the binary serialization of the result, assigning to @tglman for a check.

Thanks

Luigi

@tglman
Copy link
Member

tglman commented Dec 15, 2016

hi @temilmg,

Non Blocking query desn't support "non idempotent " query, like delete, i changed the message.
closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

5 participants