【发布时间】:2011-02-01 08:42:27
【问题描述】:
以下代码示例在 SQL Server 2005 下完美运行:
using (TransactionScope ts = new TransactionScope()) {
using (SharedDbConnectionScope scope = new SharedDbConnectionScope()) {
MyTable t = new MyTable();
t.Name = "Test";
t.Comments = "Comments 123";
t.Save();
ts.Complete();
}
}
但在 Oracle 10g 下,它会抛出“ORA-02089:从属会话中不允许提交”错误。如果我只执行 SharedDbConnectionScope 块内的代码,那么一切正常,但显然我将无法在事务下执行操作,从而冒着数据损坏的风险。
这只是我的实际应用程序的一小部分示例。我不确定是什么导致了这种行为;有没有人愿意解释一下这个问题?
这是配置:
<configSections> <section name="SubSonicService" type="SubSonic.SubSonicSection, SubSonic" requirePermission="false"/> </configSections> <connectionStrings> <add name="OracleConnection" connectionString="Data Source=XE;User Id=test;Password=test;"/> </connectionStrings> <SubSonicService defaultProvider="OracleProvider"> <providers> <clear/> <add name="OracleProvider" type="SubSonic.OracleDataProvider, SubSonic" connectionStringName="OracleConnection" generatedNamespace="OracleTest" /> </providers> </SubSonicService>
【问题讨论】:
标签: oracle subsonic transactions commit