oracle :: occi :: ResultSet :: next()使我的程序崩溃 [英] oracle::occi::ResultSet::next() crashes my program

查看:123
本文介绍了oracle :: occi :: ResultSet :: next()使我的程序崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在Windows 7上运行的64位C ++服务器应用程序,当它在数据库上执行选择并在结果集上调用next()时,该过程就简单地死掉,没有异常,没有转储,并且在ResultSet-之后没有调试信息> next().在数据库上进行写操作没有问题,并且在32位版本上进行读和写操作

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

我正在使用即时客户端和SDK随附的11.2版win64 oracle库

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

这是最简单的代码

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只是用于DB驱动程序(例如next,getField)的常用功能的接口,并且在此处实现

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
}

其中m_pResultSet是oracle :: occi :: ResultSet *

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

推荐答案

经过多次尝试,我的问题已解决.

After a lot of trys my problem is solved.

我将调试程序链接到oraocci11.lib,因为我没有调试版本,并且我认为这没什么大不了的.经过一番搜索,我发现了带有相应dll的库oraocci11d.lib的调试版本,崩溃消失了

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

这篇关于oracle :: occi :: ResultSet :: next()使我的程序崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆