terminate called after throwing an instance of 'otl_tmpl_exception<otl_exc, otl_conn, otl_cur>`解决方法
2015-01-16 17:49
956 查看
在linux下用c++连接MySQL或oracle数据库时,若频繁调用otlstream构造函数,发生 terminate called after throwing an instance of 'otl_tmpl_exception<otl_exc, otl_conn, otl_cur>`的问题,其解决方法为:
在调用otl_connect类的void rlogon(const char* connect_str, const int aauto_commit=0)函数时,将aauto_commit的值置为1。示例代码:
db.rlogon("DSN=my_db;UID=sa;PWD=tiger",1);
其中db为[b]otl_connect类的对象。[/b]
注意:第二参数aauto_commit设置为1,表示数据库事务自动提交;设置为0,表示数据库事务非自动提交。
相关文章推荐
- terminate called after throwing an instance of 'otl_tmpl_exception<otl_exc, otl_conn, otl_cur>'
- 移植CERTI解决terminate called after throwing an instance of 'certi::NetworkError'
- 解决问题: terminate called after throwing an instance of 'std::runtime_error' what(): locale::facet::
- ubuntu12.04连接服务器的时候出现错误“terminate called after throwing an instance of 'std::runtime_error' what(”
- terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check
- terminate called after throwing an instance of 'std::logic_error' what(): basic_string::_S_construct
- 运行时错误:terminate called after throwing an instance of 'std::logic_error'
- Terminate called after throwing an instance of 'ros::serialization::StreamOverrunException'
- Ubuntu16.04 terminate called after throwing an instance of 'std::logic_error'
- terminate called after throwing an instance of 'std::regex_error'
- terminate called after throwing an instance of 'std::length_error
- terminate called after throwing an instance of 'std::regex_error'(C++11)
- 运行时错误:terminate called after throwing an instance of 'std::logic_error'
- terminate called after throwing an instance of 'std::out_of_range'
- [aidl] terminate called after throwing an instance of 'std::logic_error' [aidl] what(): basic_string
- Tensorflow:terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
- terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::substr
- LeetCode terminate called after throwing an instance of 'std::logic_error' what(): basic_string::
- Deal with the error "terminate called after throwing an instance of 'std::bad_alloc'"
- 运行时错误: terminate called after throwing an instance of 'std::out_of_range'