[Mono-list] Oracle Managed ODP.NET Beta
Daniel Morgan
monodanmorg at yahoo.com
Sun Sep 30 21:48:33 UTC 2012
The beta for the fully managed edition of the ODP.NET provider fails to work on Mono.
Oracle Data Provider for .NET, Managed Driver Beta 11.2.0.3.50
http://www.oracle.com/technetwork/database/windows/downloads/odpmbeta-1696432.html
I am running Mono on Windows 7 32-bit.
Mono is version 2.11.4 for Windows.
Managed ODP.NET is designed to work on .NET 4.0. I have Visual Studio 2010 SP1 and Oracle 11g Release 2 for Windows 32-bit.
The example works on .net 4.0, but the program throws an exception on Mono.
The exception is a TypeInitializationException for OracleInternal.ServiceObjects.OracleGlobalizationImpl.
TimeZoneNotFoundException.
Or do I have something not setup correctly?
Here is the exception:
D:\projects\oracle_managed\oracle_managed\bin\Debug>mono oracle_managed.exe
Error: System.TypeInitializationException: An exception was thrown by the type i
nitializer for OracleInternal.ServiceObjects.OracleGlobalizationImpl ---> System
.TimeZoneNotFoundException: Exception of type 'System.TimeZoneNotFoundException'
was thrown.
at System.TimeZoneInfo.get_Local () [0x00000] in <filename unknown>:0
at OracleInternal.ServiceObjects.OracleGlobalizationImpl.InitFromClient (Oracl
eInternal.ServiceObjects.OracleGlobalizationImpl implObj) [0x00000] in <filename
unknown>:0
at OracleInternal.ServiceObjects.OracleGlobalizationImpl..cctor () [0x00000] i
n <filename unknown>:0
--- End of inner exception stack trace ---
at OracleInternal.ServiceObjects.OracleConnectionImpl.AlterSessionOnConnect (O
racle.ManagedDataAccess.Client.OracleConnection con) [0x00000] in <filename unkn
own>:0
at Oracle.ManagedDataAccess.Client.OracleConnection.Open () [0x00000] in <file
name unknown>:0
Press RETURN to exit.
Also, why is the Mono Windows Installer 90MB. That is huge to download.
Also, why are you including all the static libraries (they have a one letter file extension of .a)?
Most users/developers of Mono do not use these static libraries.
If developers need these archives, is it possible to create a separate installer that includes those static archives? I think the people who need it might be those who build mono or gtk# on windows.
Here is the sample program I ran to use Oracle.ManagedDataAccess.dll
using System;
using Oracle.ManagedDataAccess.Client;
using Oracle.ManagedDataAccess.Types;
namespace Connect
{
class Program
{
static void Main(string[] args)
{
try
{
// Please replace the connection string attribute settings
string constr = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=testdb11)));User ID=scott;Password=tiger";
OracleConnection con = new OracleConnection(constr);
con.Open();
Console.WriteLine("Connected to Oracle Database {0}", con.ServerVersion);
/*
OracleCommand cmd = con.CreateCommand();
cmd.CommandText = "SELECT view_name FROM all_views WHERE rownum < 5";
OracleDataReader reader = cmd.ExecuteReader();
Console.WriteLine("Views");
int viewCount = 0;
while (reader.Read())
{
string viewName = reader.GetString(reader.GetOrdinal("view_name"));
Console.WriteLine("View: {0}", viewName);
viewCount++;
}
Console.WriteLine("View count: {0}", viewCount);
*/
con.Dispose();
Console.WriteLine("Press RETURN to exit.");
Console.ReadLine();
}
catch (Exception ex)
{
Console.WriteLine("Error: {0}", ex);
Console.WriteLine("Press RETURN to exit.");
Console.ReadLine();
}
}
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20120930/b10c20c1/attachment.html>
More information about the Mono-list
mailing list