为什么运行时上下文在为 10g 编译的程序中不能在 11g 上工作?
我有一个使用 Oracle 10g(pro*c 和库)编译的多线程 C 应用程序。该程序每个线程使用一个数据库连接。我们正在转向 11g,并且在针对 11g 进行测试时,任何使用全局上下文以外的上下文的内容都会在连接到数据库时生成 SQL-02134:无效的运行时上下文
。使用全局上下文效果很好。这是从 10g 到 11g 过渡过程中已知的不兼容性,还是我做错了什么?我最终将针对 11g 重新编译所有内容,但出于实现目的,如果我们可以运行 10g 程序直到所有数据库都转换完毕,就会容易得多。
就其价值而言,该代码包含我认为正常的内容:
EXEC SQL ENABLE THREADS;
EXEC SQL CONTEXT ALLOCATE :thread_ctx
EXEC SQL CONTEXT USE :thread_ctx
I've got a multi-threaded C application that was compiled using Oracle 10g (pro*c and libraries.) The program uses one database connection per thread. We're moving to 11g and in testing against 11g, anything that uses a context other than the global context generates an SQL-02134: Invalid runtime context
when connecting to the database. Using the global context works fine. Is this a known incompatibility in the transition from 10g to 11g, or am I doing something wrong? I will eventually recompile everything against 11g, but for implementation purposes, it's much easier if we can run the 10g program until all the databases are converted.
For what it's worth, the code includes what I believe to be the normal things:
EXEC SQL ENABLE THREADS;
EXEC SQL CONTEXT ALLOCATE :thread_ctx
EXEC SQL CONTEXT USE :thread_ctx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
所以,我猜既然你说代码在执行 SQL 语句之前包含该语句,那么在执行所述 sql 之前上下文将被清除。
运行某种调试器来生成跟踪文件,以查看问题传播的具体位置。
So, I would guess since you said that the code includes that statement before executing the SQL statement that the context is being cleared before you execute said sql.
Run a debugger of some kind to produce a trace file to see where exactly the issue is propagating.