MySQL Forums
Forum List  »  Connector/ODBC

MySQL ODBC Driver 3.51 : System.InvalidOperationException: ERROR - unable to allocate an environment handle.
Posted by: Banty M
Date: January 28, 2015 09:06AM

Hi,

I am using MySQL ODBC Driver 3.51 to connect my database from windows machine using C# .Net.

My program is performing multiple inserts & updates in many tables during batch processing. it is working fine for small batch file, however it is giving me below exception when my batch file is huge. i.e. 100K records.

Moreover, my program is using single shared connection throughout processing the batch file. I have observed that my RAM utilization was getting up gradually and went down as soon as execution completes, however for huge file i am getting below exception as soon as my RAM reaches to its cap.

Let me know that how can i resolve this?

System.InvalidOperationException: ERROR - unable to allocate an environment handle.
at System.Data.Odbc.OdbcHandle..ctor(SQL_HANDLE handleType, OdbcHandle parentHandle)
at System.Data.Odbc.OdbcConnection.CreateStatementHandle()
at System.Data.Odbc.OdbcCommand.GetStatementHandle()
at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader, Object[] methodArguments, SQL_API odbcApiMethod)
at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader)
at System.Data.Odbc.OdbcCommand.ExecuteNonQuery()

Thanks in advance for your valuable input.

Options: ReplyQuote


Subject
Written By
Posted
MySQL ODBC Driver 3.51 : System.InvalidOperationException: ERROR - unable to allocate an environment handle.
January 28, 2015 09:06AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.