sqlanywhere / node-sqlanywhere

SAP SQL Anywhere Database Client for Node
Apache License 2.0
39 stars 37 forks source link

Race condition when doing a disconnect in exec callback #3

Closed efarrar closed 10 years ago

efarrar commented 10 years ago

A bug was introduced by the fix to #2 that causes a crash. If the callback to an exec statement does an immediate disconnect, there is a race condition between the clean-up of the prepared statement (created by the exec), and the disconnection. The clean-up code should be modified to check if the database connection is still active before trying to clear the prepared statement.