I'm getting an ORA-24762 on commit after executing a SQL command that is an anonymous PL/SQL block within a TransactionScope.
I re-created the problem in a simple app:
1) Create a Silverlight App
2) Add an ADO.NET Entity Data Model
- just select a dotConnect for Oracle connection
- no entities added to model
3) Add a Domain Service Class
- include RIA Services
4) Add a reference to System.ServiceModel.DomainServices.EntityFramework
5) Edit the Domain Service Class:
Code: Select all
namespace TestORA24762.Web
{
using System.Data;
using System.Data.Common;
using System.Data.EntityClient;
using System.ServiceModel.DomainServices.EntityFramework;
using System.ServiceModel.DomainServices.Hosting;
using System.ServiceModel.DomainServices.Server;
using System.Text;
using System.Transactions;
[EnableClientAccess()]
public class DualDomainService : LinqToEntitiesDomainService
{
static object obj = null;
static DualDomainService()
{
try
{
System.Reflection.Assembly assembly = System.Reflection.Assembly.Load("Devart.Data.Oracle, Version=6.0.70.0, Culture=neutral, PublicKeyToken=09af7300eec23701");
System.Type ttt = assembly.GetType("Devart.Data.Oracle.OracleMonitor");
obj = System.Activator.CreateInstance(ttt);
System.Reflection.PropertyInfo property = ttt.GetProperty("IsActive");
property.SetValue(obj, true, null);
}
catch (System.Exception exc) { }
}
[Invoke]
public int PokeDual(string y)
{
using (TransactionScope tran = new TransactionScope())
{
StringBuilder sqlbuf = new StringBuilder();
sqlbuf.Append("declare x varchar2(1); begin select dummy into x from dual where dummy = :y; end;");
DbConnection conn = (DbConnection)((EntityConnection)this.ObjectContext.Connection).StoreConnection;
if (conn.State != ConnectionState.Open)
{
conn.Open();
}
int result = 0;
using (DbCommand cmd = conn.CreateCommand())
{
cmd.CommandText = sqlbuf.ToString();
IDbDataParameter dbp = cmd.CreateParameter();
dbp.ParameterName = "y";
dbp.DbType = DbType.String;
dbp.Value = "x";
cmd.Parameters.Add(dbp);
result = cmd.ExecuteNonQuery();
}
tran.Complete();
return result;
}
}
}
}
When I run this against Oracle (see versions below), I get the ORA-24762 error on commit. dbMonitor shows the error as well.
Oracle Versions from v$version:
Oracle Database 11g Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
Has anyone else seen this?
Any assistance would be much appreciated.
Thanks!
Dave