Hi there,
I have a MS SQL Server database (not managed by me) and I've been integrating it in my application. I just pull some data and put them in my database (PostGreSQL). In my class I open the connection, send the proper query and deliver the data to another class (using ValueMaps) that save them in my db. The destructor of the class that queries MS SQL is has follows:
MssqlDAO::~MssqlDAO(){
if(cbdb.IsOpen()) //cddb is the session declared as "MSSQLSession cbdb;" in the header file
cbdb.Close();
}
This sometimes (not every time) leads to unexpected crash. I have no clue, because the code is fairly easy and should run. I tried to add a Sleep(1000) before Close(), but with no luck.
Hi there,
I have a MS SQL Server database (not managed by me) and I've been integrating it in my application. I just pull some data and put them in my database (PostGreSQL). In my class I open the connection, send the proper query and deliver the data to another class (using ValueMaps) that save them in my db. The destructor of the class that queries MS SQL is has follows:
MssqlDAO::~MssqlDAO(){
if(cbdb.IsOpen()) //cddb is the session declared as "MSSQLSession cbdb;" in the header file
cbdb.Close();
}
This sometimes (not every time) leads to unexpected crash. I have no clue, because the code is fairly easy and should run. I tried to add a Sleep(1000) before Close(), but with no luck.
Has anyone an idea on this?
Thanks,
giorgio
Please check that there are no active Sql instances connected to that session...