JAVA调用SYBASE过程报过程模式不对的处理
2009-04-08 10:44
756 查看
通过JAVA、JDBC驱动为JTDS1.2调用SYBASE12.5存储过程的时候,老是报该过程只允许在"Unchained"模式下运,通过命令sp_procxmode查看的时候,该过程也是"Unchained"模式,Hibernate报运行命令"set chained off"即可将当前库的存储过程运行模式改为"Unchianed",但执行后也不行;后面在一个国外的网站查到,将其运行模式改为"anymode"即可,采用命令:sp_procxmode 过程名 'anymode' ,但要修改所有与该过程相关的,被该过程调用的模式都为"anymode"才行,据说只有Sybase有这个毛病,其它的数据库都没有这个问题。
注:chained和Unchained的分别简单的说,就是chained会自动起事务;Unchained不会自动启事务,需要用户显性的用begin tran..commit/rollback去定义。下面是英文说明:
Adaptive Server provides SQL standard-compliant “chained” transaction behavior as an option. In chained mode,all data retrieval and modification commands (delete,insert,open,fetch,select,and update) implicitly begin a transaction. Since such behavior is incompatible with many Transact- SQL applications,Transact-SQL style (or “unchained”) transactions remain the default.
举个例子
In chained transaction mode,Adaptive Server implicitly executes a begin transaction statement just before the following data retrieval or modification statements: delete,insert,open,fetch,select,and update. For example,the following group of statements produce different results,depending on which mode you use: insert into publishers values ("9906",null,null,null) begin transaction delete from publishers where pub_id = "9906" rollback transaction In unchained transaction mode,the rollback affects only the delete statement,so publishers still contains the inserted row. In chained mode,the insert statement implicitly begins a transaction,and the rollback affects all statements up to the beginning of that transaction,including the insert.
本文出自:冯立彬的博客
相关文章推荐
- java调用dll文件处理过程
- 黑马程序员_Java基础_面向对象(Static的使用、对象初始化和调用成员过程、单例设计模式)
- java调用存储过程 中DATE参数的处理
- sybase存储过程的写法以及java的调用方法
- java调用存储过程时,返回结果不是ResultSet的时候的处理
- MFC应用程序中处理消息,创建窗口的过程,关闭窗口(非模态窗口),打开模式对话框等的函数调用顺序
- java调用oracle存储过程传入参数为数组的处理
- MFC应用程序中处理消息,创建窗口的过程,关闭窗口(非模态窗口),打开模式对话框等的函数调用顺序 .
- Java 调用存储过程中传递集合类型处理方法
- 【GOF23设计模式】_责任链模式_公文审批_供应链系统的采购审批_异常链_过滤器和拦截器调用过程JAVA243
- java方法调用过程解析和执行--编译器的处理
- Linux系统调用的system_call处理过程分析
- Java设计模式(3)Template Method模式 将具体处理交给子类
- oralce java中调用过程
- java调用Oracle分页存储过程
- JAVA设计模式-事务处理
- android c++ 调用java 提示“xxx class 找不到”的处理方法
- 存储过程定义调用以及java调用存储过程
- java调用储存过程的方法
- java下实现调用oracle的存储过程和函数