{"action":"created","issue":{"url":"https://api.github.com/repos/oracle/node-oracledb/issues/106","labels_url":"https://api.github.com/repos/oracle/node-oracledb/issues/106/labels{/name}","comments_url":"https://api.github.com/repos/oracle/node-oracledb/issues/106/comments","events_url":"https://api.github.com/repos/oracle/node-oracledb/issues/106/events","html_url":"https://github.com/oracle/node-oracledb/issues/106","id":84570242,"number":106,"title":"Error: ORA-01000: maximum open cursors exceeded --- With Connexion Pool","user":{"login":"BlackMatrix971","id":12731981,"avatar_url":"https://avatars.githubusercontent.com/u/12731981?v=3","gravatar_id":"","url":"https://api.github.com/users/BlackMatrix971","html_url":"https://github.com/BlackMatrix971","followers_url":"https://api.github.com/users/BlackMatrix971/followers","following_url":"https://api.github.com/users/BlackMatrix971/following{/other_user}","gists_url":"https://api.github.com/users/BlackMatrix971/gists{/gist_id}","starred_url":"https://api.github.com/users/BlackMatrix971/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlackMatrix971/subscriptions","organizations_url":"https://api.github.com/users/BlackMatrix971/orgs","repos_url":"https://api.github.com/users/BlackMatrix971/repos","events_url":"https://api.github.com/users/BlackMatrix971/events{/privacy}","received_events_url":"https://api.github.com/users/BlackMatrix971/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/oracle/node-oracledb/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":30,"created_at":"2015-06-03T13:40:46Z","updated_at":"2015-06-09T19:07:21Z","closed_at":null,"body":"I created an asynchronous ExecuteQuery function that is able to execute query asynchronously so that if ever it's called \r\ninside a loop, the next query wait for the former one finishes before been executed.\r\nThe doCreatePool function is called once, at program initialization.\r\nIt creates a connexion pool and save it in  the Global variable config.Oracle_POOL so that the connexion pool remains alive, \r\neven after then doCreatePool returns.\r\n'\r\n\r\nSocket.io events call ExecuteQuery to execute queries (either one, or more in a loop).\r\n\r\nEverything goes right but, after a certain amount of queries executed, \r\nI get an ORA-1000 error : \"Error: ORA-01000: maximum open cursors exceeded\"\r\neither for select, update and insert queries.\r\n\r\nNormally the Connexion pool is supposed to avoid this issue ?\r\n\r\nWhat is wong in my code ?\r\n\r\n```\r\ndoCreatePool (); //Create a connexion pool and save it in config.Oracle_POOL\r\n//dbConfig={....}\r\n\r\nfunction doCreatePool () {\r\n    dbConfig=config.Settings.DataBaseConnexionString;\r\n    oracle.createPool (\r\n      {\r\n        user          : dbConfig.user,\r\n        password      : dbConfig.password,\r\n        connectString : dbConfig.connectString,\r\n        poolMax       : 44,\r\n        poolMin       : 2,\r\n        poolIncrement : 5,\r\n        poolTimeout   : 4\r\n      },\r\n      function(err, pool)\r\n      {\r\n        if (err) {\r\n          console.error(\"createPool() callback: \" + err.message);\r\n          return;\r\n        } else {\r\n            config.Oracle_POOL = pool;\r\n        }\r\n     });      \r\n}\r\n\r\nfunction ExecuteQuery(Query, LstParam, callBack) {\r\n\r\n\tconfig.Oracle_POOL.getConnection( function(err, connection) {\r\n\t\tif (err){ \r\n\t\t\tconsole.log(\"Oracle connexion pool --> err --> \", err);\r\n\t\t\tif (connection)\r\n\t\t\tconnection.release(\r\n                function(err) {\r\n                \tif (err) {\r\n                \t\tconsole.log(\"(1) connection.release --> err--> \",err)\r\n                \t}\r\n                }\r\n            );  \r\n            callBack(err, { rows : [] });  \t\r\n\t\t} else {\r\n\t\t\tvar OracleQueryOptions={outFormat: oracle.OBJECT, maxRows : 500, autoCommit : true};\r\n\t\t\tconnection.execute(Query, LstParam, OracleQueryOptions , function(err, results) {\r\n\t\t\t\tif (!err) {\r\n\t\t\t\t\tconsole.log(\"* connection.execute  --> err--> \",err, \"Query --> \", Query);\r\n\t\t\t\t}\r\n\t\t\t\tconnection.release( function(err2) {\t                    \t\r\n                    \tif (err2) {\r\n                    \t\tconsole.log(\"(2) connection.release --> err-->\",err)\r\n                    \t}\r\n\t\t\t\t\t\tcallBack(err, results);\r\n                    }\r\n                );\r\n\t\t\t});\r\n\t\t}\r\n\t});\t\t\r\n\t\t\t\r\n\t\t\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/oracle/node-oracledb/issues/comments/110466661","html_url":"https://github.com/oracle/node-oracledb/issues/106#issuecomment-110466661","issue_url":"https://api.github.com/repos/oracle/node-oracledb/issues/106","id":110466661,"user":{"login":"dmcghan","id":585767,"avatar_url":"https://avatars.githubusercontent.com/u/585767?v=3","gravatar_id":"","url":"https://api.github.com/users/dmcghan","html_url":"https://github.com/dmcghan","followers_url":"https://api.github.com/users/dmcghan/followers","following_url":"https://api.github.com/users/dmcghan/following{/other_user}","gists_url":"https://api.github.com/users/dmcghan/gists{/gist_id}","starred_url":"https://api.github.com/users/dmcghan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmcghan/subscriptions","organizations_url":"https://api.github.com/users/dmcghan/orgs","repos_url":"https://api.github.com/users/dmcghan/repos","events_url":"https://api.github.com/users/dmcghan/events{/privacy}","received_events_url":"https://api.github.com/users/dmcghan/received_events","type":"User","site_admin":false},"created_at":"2015-06-09T19:07:21Z","updated_at":"2015-06-09T19:07:21Z","body":"@BlackMatrix971 After making the changes you suggested I also changed the timeout to 1 second. The code ran for over 16 hours without any issues. The number of open connections never exceeded 2 and the connections in use never exceeded 1. I am unable to reproduce the error with this test.\r\n\r\nHowever, @cjbj's theory about the statement cache size makes a lot of sense because your code could generate many dynamic queries (something the test doesn't show). Why not try setting the stmtCacheSize to 0 to see if you still get the ORA-01000?"}}