oracle::occi::ResultSet::next() crashes my program

此生再无相见时 提交于 2019-12-13 05:46:43

问题


I have a 64 bits C++ server application running on windows 7 and when it does a select on the database and calls next() on the result set the process simply dies, no exceptions, no dumps and no debug info after ResultSet->next(). Writes on the database works with no problems and both reads and writes works on the 32 bit version

I'm using the 11.2 version of the win64 oracle libraries that came with instant client and SDK

EDIT: it's the simplest of codes

const std::string sql("select * from schedule_import");

std::auto_ptr<IRecordSet> query = m_conn->Open(sql);

while(query->Next()) // dies
{
  const std::string key(query->GetField("bean_key"));
  //...

IRecordSet is just an interface for common functions of DB drivers like next, getField and it's implemented in here

bool OracleRecordSet::Next()
{
  return m_pResultSet->next() != NULL; //crashes here
}

where m_pResultSet is a oracle::occi::ResultSet*


回答1:


I'm not familiared with Oracle API, but question is if m_pResultSet is not NULL (in case of segmentation fault) and if there is no exception (in case of abort(), raise() stack).

BR!




回答2:


After a lot of trys my problem is solved.

I was linking my debug program to oraocci11.lib because I didn't have the debug version and I thought it didn't matter much. After a bit of search I've found the debug version of the library, oraocci11d.lib, with the corresponding dll and the crash is gone



来源:https://stackoverflow.com/questions/10803306/oracleocciresultsetnext-crashes-my-program

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!