lexcorp / assql

Automatically exported from code.google.com/p/assql
0 stars 0 forks source link

Concurrency error while exceuting stored procedure using method Statement.executeQuery() and Statement.executeCall() #97

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Description
1. It comes from Connection.setDataHandler.

2. Reason is that application is trying to set data handler to connection 
one data handler is already set. 

3.This error start coming after assql incorporate changes for calling
stored procedure using Statement.executeCall (changed the check for “call”
statement using lowercase). 

4.Statement.executeCall method is setting the datahandler for some handling
on receiving the result.     

Solution: We have removed the changes done in assql.Statement.executeQuery
for checking the “Call” statement using lowercase. Now assql is again
executing the stored procedures call as simple queries. This is a temporary
solution for now.

Original issue reported on code.google.com by anujshar...@gmail.com on 9 Mar 2010 at 12:39

GoogleCodeExporter commented 9 years ago
This case comes if we are giving multiple calls for query execution 
simultaneoulsy.

Original comment by anujshar...@gmail.com on 9 Mar 2010 at 1:24

GoogleCodeExporter commented 9 years ago
Is this occurring using Beta 2.8?

Original comment by macl...@gmail.com on 9 Mar 2010 at 2:07

GoogleCodeExporter commented 9 years ago
Anuj you must be using an older version. Why dont you check the repository for 
an
updated solution?

If you look at
http://code.google.com/p/assql/source/browse/trunk/assql/asSQL_PureAS3/src/com/m
aclema/mysql/Statement.as

You will see this on line 159

 if ( this.sql.toLocaleLowerCase().indexOf("call") == 0 ) {
                        return executeCall();
 }

Original comment by clinton....@gmail.com on 11 Mar 2010 at 12:55

GoogleCodeExporter commented 9 years ago
Hi Maclema - We are using the latest version.  

Hi Clinton - From above description, we means that this error start coming after
latest change i.e. "this.sql.toLocaleLowerCase().indexOf("call") == 0". As now,
stored procedures are handled by executeCall() method where API is registering 
some
data handlers internally. Here we are getting "Concurrent Error" from
Connection.setDataHandler.

We just tried by commenting this change, considering that it might solve the 
problem
temporarily for us but we got another issues after trying this temporary 
solution. 

Original comment by anujshar...@gmail.com on 17 Mar 2010 at 11:42

GoogleCodeExporter commented 9 years ago
are you getting the "Concurrency Error" on multiple reads or multiple writes?

Original comment by clinton....@gtempaccount.com on 22 Mar 2010 at 5:24

GoogleCodeExporter commented 9 years ago
Hi Clinton

We are actually running stored procedure calls.

Let me try to explain the scenario which regenerates the issue
1) in a loop try to send as many sproc calls(all calling same sproc)
2) from the result of each sproc call try to send another call to some other 
sproc
3) concurrency error recieved

What actually the assql is doing is, pooling all the calls made from the loop 
and at
once handles all the responses. Now if I don't make the second sproc call 
everything
works fine.

But while handling result, if we have a sproc call made. The assql generates me
concurrency error. Following is the stack trace

Error: Concurrency Error
    at
com.maclema.mysql::Connection/setDataHandler()[D:\data\anuj\Projects\UIS-Code\sr
c\com\maclema\mysql\Connection.as:520]
    at <anonymous>()[D:\data\anuj\Projects\UIS-Code\src\com\maclema\mysql\Statement.as:270]
    at
com.maclema.mysql::MySqlToken/handleResponse()[D:\data\anuj\Projects\UIS-Code\sr
c\com\maclema\mysql\MySqlToken.as:90]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at
QueryHandler/handleResultSetRowsEofPacket()[D:\data\anuj\Projects\UIS-Code\src\c
om\maclema\mysql\QueryHandler.as:78]
    at
QueryHandler/handleEofPacket()[D:\data\anuj\Projects\UIS-Code\src\com\maclema\my
sql\QueryHandler.as:61]
    at
QueryHandler/handleNextPacket()[D:\data\anuj\Projects\UIS-Code\src\com\maclema\m
ysql\QueryHandler.as:154]
    at
QueryHandler/newPacket()[D:\data\anuj\Projects\UIS-Code\src\com\maclema\mysql\Qu
eryHandler.as:32]
    at
DataHandler/pushPacket()[D:\data\anuj\Projects\UIS-Code\src\com\maclema\mysql\Da
taHandler.as:48]
    at
com.maclema.mysql::Connection/checkForPackets()[D:\data\anuj\Projects\UIS-Code\s
rc\com\maclema\mysql\Connection.as:485]
    at
com.maclema.mysql::Connection/onSocketData()[D:\data\anuj\Projects\UIS-Code\src\
com\maclema\mysql\Connection.as:458]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at
QueryHandler/handleResultSetRowsEofPacket()[D:\data\anuj\Projects\UIS-Code\src\c
om\maclema\mysql\QueryHandler.as:78]
    at
QueryHandler/handleEofPacket()[D:\data\anuj\Projects\UIS-Code\src\com\maclema\my
sql\QueryHandler.as:61]
    at
QueryHandler/handleNextPacket()[D:\data\anuj\Projects\UIS-Code\src\com\maclema\m
ysql\QueryHandler.as:154]
    at
QueryHandler/newPacket()[D:\data\anuj\Projects\UIS-Code\src\com\maclema\mysql\Qu
eryHandler.as:32]
    at
DataHandler/pushPacket()[D:\data\anuj\Projects\UIS-Code\src\com\maclema\mysql\Da
taHandler.as:48]
    at
com.maclema.mysql::Connection/checkForPackets()[D:\data\anuj\Projects\UIS-Code\s
rc\com\maclema\mysql\Connection.as:485]
    at
com.maclema.mysql::Connection/onSocketData()[D:\data\anuj\Projects\UIS-Code\src\
com\maclema\mysql\Connection.as:458]

Original comment by anujshar...@gmail.com on 30 Mar 2010 at 11:28

GoogleCodeExporter commented 9 years ago
Hi,

Is there any update for the problem ?

Original comment by anujshar...@gmail.com on 12 Apr 2010 at 6:08

GoogleCodeExporter commented 9 years ago
Hi 

I am facing the same issue, Anuj is there any update on this?

Original comment by vipulsha...@gmail.com on 17 Apr 2010 at 11:09