ora-03115 running on mono
ora-03115 running on mono
Im getting ora-03115: unsupported network datatype or representation when I run on mono but it works ok on windows. The one thing running on mono is that I have to set directmode=true and I noticed that another post mentioned that this mode doesnt support binary_double and the table being selected has a binary double in it . Given that , is there any way to not use direct mode on mono to get arround this issue or is there any other way we can get around this issue. The main reason we are looking at devart is to use it on mono since monos oracle driver has a lot of issues but so far devart seems to work pretty good on mono other than this issue so any help would be appreciated.
thanks
scott
thanks
scott
dotConnect for Oracle works only in Direct Mode on Mono. Here is a description of Direct Mode with a list of its limitations (BINARY_DOUBLE is not available): http://www.devart.com/dotconnect/oracle ... tMode.html.
As a workaround, we recommend you to create a view for your table with BINARY_DOUBLE and to cast this type to NUMBER:
As a workaround, we recommend you to create a view for your table with BINARY_DOUBLE and to cast this type to NUMBER:
Code: Select all
--DROP TABLE B_D;
CREATE TABLE B_D (
ID NUMBER(38),
BD BINARY_DOUBLE,
CONSTRAINT PK_B_D PRIMARY KEY (ID));
CREATE OR REPLACE VIEW B_D_VIEW (
ID,
BD
)
AS
SELECT "ID",CAST("BD" as NUMBER) FROM B_D
;
this would handle selecting but then there is also inserts and updating. The other problem is we are using nhibernate and supporting other databases like sqlserver so we are limited on how much we hard coding this specific situation. Is there some other type we can use rather than binary_double and binary_float to support saving a .net double . for example , try saving a .net Double.Maxvalue into oracle into anything other than an binary_double. I tried a fiew things like using Number but I couldnt find anything that works other than binary_double . Is there another oracle type that might work or maybe on the backend it could be binary_double but devar parameter could be something that would would in direct mode. Is there any way to get direct mode to support these type?
thanks
scott
thanks
scott
We recommend you using the following workarounds when working with BINARY_DOUBLE:
1) select -
select TO_CHAR(binary_double_column) from myTable
2) insert -
cmd.Parameters.Add("p2", OracleDbType.VarChar).Value = Double.MaxValue.ToString("r", CultureInfo.InvariantCulture);
There is no technical possibility to implement the BINARY_DOUBLE support in Direct Mode at the moment.
1) select -
select TO_CHAR(binary_double_column) from myTable
2) insert -
cmd.Parameters.Add("p2", OracleDbType.VarChar).Value = Double.MaxValue.ToString("r", CultureInfo.InvariantCulture);
There is no technical possibility to implement the BINARY_DOUBLE support in Direct Mode at the moment.
it all works ok but when I try to persist a Double.MaxValue , it inserts ok but the select returns this error:
{"Input string was not in a correct format."}
is there a limitation of this based on the size of the double coming back? when that double.maxvalue comes back as a string and its converted back to a double you have to be carefull since you could run into a rounding error and cause this double.maxvalue be rounded up and become invalid if you dont specify the format option of "r". This is a know problem to watch out for when converting its string representation to a double.maxvalue so do you think a problem like this could be happening?
{"Input string was not in a correct format."}
is there a limitation of this based on the size of the double coming back? when that double.maxvalue comes back as a string and its converted back to a double you have to be carefull since you could run into a rounding error and cause this double.maxvalue be rounded up and become invalid if you dont specify the format option of "r". This is a know problem to watch out for when converting its string representation to a double.maxvalue so do you think a problem like this could be happening?
Please modify the following sample so that we can reproduce the error in our environment.
Also please tell us your versions of dotConnect for Oracle (x.xx.xxx) and Oracle Server (xx.x.x.x).
Code: Select all
// CREATE TABLE BD_table (BD_column BINARY_DOUBLE);
static double result;
using (OracleConnection conn = new OracleConnection()) {
conn.ConnectionString = "server=db;port=***;SID=***;Direct=true;uid=***;pwd=***;";
conn.Open();
OracleCommand cmd = conn.CreateCommand();
cmd.CommandText = "truncate table bd_table";
cmd.ExecuteNonQuery();
cmd.CommandText = "insert into bd_table values (:p1)";
cmd.Parameters.Add("p1", OracleDbType.VarChar).Value = Double.MaxValue.ToString("r");
cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
cmd.CommandText = "select TO_CHAR(bd_column) from bd_table";
OracleDataReader reader = cmd.ExecuteReader();
while (reader.Read()){
result = double.Parse(reader.GetValue(0).ToString());
}
}
I see the problem, in your sample you have Value= Double.MaxValue.ToString("r");
if you dont do the ToString then you will get the error when you read it back . The problem is Nhibernate thinks this is a double going into a number field so of course it doenst do a ToString which is probably the problem. Unfortunatly I have no hook into nhibernate to do the ToString so Im a little stuck here. Im not sure if you know nhibernate but do know if there is a way to do this through nhibernate?
if you dont do the ToString then you will get the error when you read it back . The problem is Nhibernate thinks this is a double going into a number field so of course it doenst do a ToString which is probably the problem. Unfortunatly I have no hook into nhibernate to do the ToString so Im a little stuck here. Im not sure if you know nhibernate but do know if there is a way to do this through nhibernate?