Search found 149 matches

by Alladin
Tue 10 Mar 2015 13:05
Forum: dotConnect for Oracle
Topic: License error
Replies: 1
Views: 1201

License error

Hi there,

After upgrading to VS2015 CTP6, DevArt oracle drivers lost their license.
File licenses.licx is part of the project, lc.exe successfully runs.

Looks like DevArt drivers are not compatible with new C# compiler somehow.


Could you please check?

Thank you in advance,
Lex
by Alladin
Thu 08 Aug 2013 12:53
Forum: dotConnect for Oracle
Topic: EF Update without ROWID
Replies: 7
Views: 1544

Re: EF Update without ROWID

For optimistic locking check, this SQL would work better:

Code: Select all

DECLARE
  RC$ NUMBER;

BEGIN

UPDATE MYTABLE
SET LASTLOGINTIME = :p0 
WHERE ID = :p1 AND TS = :p2;

RC$ := SQL%ROWCOUNT;

OPEN :outParameter FOR 
SELECT TS,...[other Sync OnUpdate columns] FROM MYTABLE
WHERE ID = :p1 AND RC$ > 0;

END;
Returning cursor will yield no records in case of optimistic lock.
by Alladin
Mon 05 Aug 2013 13:01
Forum: dotConnect for Oracle
Topic: Different Read/Update Views/Tables
Replies: 5
Views: 1308

Re: Different Read/Update Views/Tables

Using Stored Procedures especially for Update is really bad idea, because it requires to load entities before update to get all original column values. It is bad idea because of:

1) Simple attachment of entity to ObjectContext and marking some properties as modified corrupts the data.

2) Roundtrip of unchanged data is just very bad design. (What if you have blobs?)

And generally rely on existence of ROWID, knowing that ORACLE DOES NOT SUPPORT it everywhere is just bad design decision for LinqConnect/EF.
by Alladin
Mon 05 Aug 2013 09:13
Forum: dotConnect for Oracle
Topic: EF Update without ROWID
Replies: 7
Views: 1544

Re: EF Update without ROWID

Any news? Test project was send on 31 Juli.
by Alladin
Tue 30 Jul 2013 10:30
Forum: dotConnect for Oracle
Topic: Different Read/Update Views/Tables
Replies: 5
Views: 1308

Different Read/Update Views/Tables

Hi there,

Is it possible to specify different table/view names for SELECT and DML operations for Entity Framework?

The reason:
1) I have a normal table USERS with data (TS column used for concurrency check, filled in trigger on insert and update - StoreGeneratedPattern - Computed).
2) I have a view TUSERS, that exposes USERS table and adds few calculated columns.
3) I have instead of trigger on TUSERS view, that intercepts changes to calculated columns and performs additional business logic.
4) EF fails to update TUSERS because of RETURNING statement.

Possible solutions:
A) Make DevArt EF to generate valid SQL for DML (e.g. WITHOUT RETURNING, but with Entity Keys). Estimated time?

B) Add empty columns to USERS table, define normal trigger just for those columns, implement business logic inside the trigger. In this case USERS and TUSERS have the same structure, so TUSERS can be used for SELECT and USERS for DML. So RETURNING will work properly. Now the question, how to tell DevArt EF to use different table names for SQL generation?

UPDATE1.

C) As a variant, possibility to intercept DbCommand before execution (aka EF6) and modify CommandText. How realistic?

D) Any other solutions? maybe there is an typical solution I miss?

Thank you in advance,
Lex
by Alladin
Mon 29 Jul 2013 21:05
Forum: dotConnect for Oracle
Topic: EF Update without ROWID
Replies: 7
Views: 1544

EF Update without ROWID

Hi there,

I have an updatable view with INSTEAD OF triggers defined. Such views don't support RETURNING clause (ORA-22816: unsupported feature with RETURNING clause), and dotConnect fails to update those views because of generated SQL for update:

Code: Select all

DECLARE
  updatedRowid ROWID;
BEGIN
UPDATE TUSERS
   SET LASTLOGINTIME = :p0
 WHERE ID = :p1 AND TS = :p2
RETURNING ROWID INTO updatedRowid;
OPEN :outParameter FOR SELECT TS FROM TUSERS WHERE ROWID = updatedRowid;
END;
How is it possible to tell dotConnect EF to use ENTITY KEYS (ID in this case, TS is concurrency check) instead of ROWID pseudocolumn? At the end it must look like this:

Code: Select all

BEGIN
UPDATE TUSERS
   SET LASTLOGINTIME = :p0
 WHERE ID = :p1 AND TS = :p2;
OPEN :outParameter FOR SELECT TS FROM TUSERS WHERE ID = :p1;
END;
by Alladin
Mon 29 Jul 2013 20:57
Forum: dotConnect for Oracle
Topic: TIMESTAMP Precision axed
Replies: 4
Views: 1207

Re: TIMESTAMP Precision axed

I've upgraded dotConnect, replaced WCF OData endpoints with custom ones, simplified queries - now everything works as expected.
by Alladin
Thu 18 Jul 2013 11:36
Forum: dotConnect for Oracle
Topic: TIMESTAMP Precision axed
Replies: 4
Views: 1207

Re: TIMESTAMP Precision axed

CREATE TABLE BLA (TS TIMESTAMP)

Some model for this table (DateTime column for TS)

var ts = DateTime.Now;

from bla in context.Blas where bla.Ts > ts select bla;

See resulting SQL:

SELECT
...
WHERE t.TS > TO_TIMESTAMP('2013-07-18 13:35:23.7230000', 'yyyy-mm-dd hh24:mi:ss.ff')

Where does DateTime format 'yyyy-mm-dd hh24:mi:ss.ff' come from? Is it hard coded?
by Alladin
Fri 05 Jul 2013 21:32
Forum: dotConnect for Oracle
Topic: TIMESTAMP Precision axed
Replies: 4
Views: 1207

TIMESTAMP Precision axed

Hi there,

I have a simple TIMESTAMP column. EF and Oracle can successfully roundtrip fractions of the seconds. However, if I use my TIMESTAMP column in queries, generated SQL looks dead wrong.

Timestamp columns are filled with SysTimeStamp Oracle function by default, so yes, these values are real.

Here is an example:

SELECT ....
FROM TINDEXES "Extent1"
WHERE "Extent1".TS > TO_TIMESTAMP('2013-06-29 20:14:58.7230000', 'yyyy-mm-dd hh24:mi:ss.ff')
ORDER BY "Extent1".ID ASC

Obviously fractions of seconds get axed, so business logic fails.

Where can one configure the precision of this 'yyyy-mm-dd hh24:mi:ss.ff' format?

EF4/.NET 4/Oracle 11G R2

Thank you in advance,
Lex
by Alladin
Wed 10 Oct 2012 08:55
Forum: dotConnect for Oracle
Topic: Force a Guid to be stored as VARCHAR using EF code first
Replies: 3
Views: 6367

Re: Force a Guid to be stored as VARCHAR using EF code first

I'd suggest to declare Guid column as string all the way through tiers.
Guid type is well supported type in general. So use a string as a Id property type, just write there Guid.ToString() and you are good to go ;)
by Alladin
Fri 05 Oct 2012 15:13
Forum: dotConnect for Oracle
Topic: AcccessViolation Exception
Replies: 30
Views: 6235

Re: AcccessViolation Exception

Ok. Now AccessViolation exception is gone, but OverflowException thrown.

Code: Select all

   at Devart.Data.Oracle.OracleTimeStamp..ctor(IntPtr A_0, OracleDbType A_1, bf A_2)
   at Devart.Data.Oracle.w.l(Byte[] A_0, Int32 A_1, Int32 A_2)
   at Devart.Data.Oracle.av.f(Byte[] A_0, Int32 A_1, Int32 A_2)
   at Devart.Data.Oracle.Entity.ab.a(Int32 A_0)
   at System.Data.Common.Internal.Materialization.Shaper.ErrorHandlingValueReader`1.GetValue(DbDataReader reader, Int32 ordinal)
   at System.Data.Common.Internal.Materialization.Shaper.GetPropertyValueWithErrorHandling[TProperty](Int32 ordinal, String propertyName, String typeName)
   at lambda_method(Closure , Shaper )
   at System.Data.Common.Internal.Materialization.Shaper.HandleEntityAppendOnly[TEntity](Func`2 constructEntityDelegate, EntityKey entityKey, EntitySet entitySet)
   at lambda_method(Closure , Shaper )
   at System.Data.Common.Internal.Materialization.Coordinator`1.ReadNextElement(Shaper shaper)
   at System.Data.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.MoveNext()
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source)
by Alladin
Mon 24 Sep 2012 11:34
Forum: dotConnect for Oracle
Topic: AcccessViolation Exception
Replies: 30
Views: 6235

Re: AcccessViolation Exception

Here are the oracle instance parameters:

Code: Select all

PARAMETER                VALUE
NLS_CALENDAR             GREGORIAN
NLS_CHARACTERSET         AL32UTF8
NLS_COMP                 BINARY
NLS_CURRENCY             #
NLS_DATE_FORMAT          DD-MON-RR
NLS_DATE_LANGUAGE        ENGLISH
NLS_DUAL_CURRENCY        ?
NLS_ISO_CURRENCY         UNITED KINGDOM
NLS_LANGUAGE             ENGLISH
NLS_LENGTH_SEMANTICS     BYTE
NLS_NCHAR_CHARACTERSET   UTF8
NLS_NCHAR_CONV_EXCP      FALSE
NLS_NUMERIC_CHARACTERS   .,
NLS_RDBMS_VERSION        11.2.0.3.0
NLS_SORT                 BINARY
NLS_TERRITORY            UNITED KINGDOM
NLS_TIMESTAMP_FORMAT     DD-MON-RR HH24.MI.SSXFF
NLS_TIMESTAMP_TZ_FORMAT  DD-MON-RR HH24.MI.SSXFF TZR
NLS_TIME_FORMAT          HH24.MI.SSXFF
NLS_TIME_TZ_FORMAT       HH24.MI.SSXFF TZR
by Alladin
Mon 24 Sep 2012 09:42
Forum: dotConnect for Oracle
Topic: AcccessViolation Exception
Replies: 30
Views: 6235

Re: AcccessViolation Exception

1. Does the problem occur in your environment permanently or intermittently?
It always happens. IIS 8/Windows 8 Pro/x64 bit/.NET 4.5

2. Specify the version of your Oracle server.
Oracle server 11.2.0.3.0, Windows 8 Server.

3. Post here a code snippet you are using to retrieve data.

Code: Select all

static void Main(string[] args)
    {
      using (var conn = new OracleConnection("User Id=A;Password=B;Server=C;Unicode=true;"))
      {
        conn.Open();

        /// this query works
        using (var cmd = new OracleCommand("select t.id from environments t", conn))
        using (var reader = cmd.ExecuteReader())
          while (!reader.EndOfData)
            reader.Read();

        /// this query fails (ts column is timestamp(6))
        using (var cmd = new OracleCommand("select t.ts from environments t", conn))
        using (var reader = cmd.ExecuteReader())
          while (!reader.EndOfData)
            reader.Read();

      }
    }


4. If possible, try the latest (7.2.77) version of dotConnect for Oracle.
Fails also with the latest version 7.2.77.
by Alladin
Fri 14 Sep 2012 14:43
Forum: dotConnect for Oracle
Topic: AcccessViolation Exception
Replies: 30
Views: 6235

Re: AcccessViolation Exception

We have the same problem. Version: 6.80.350.0, Latest Oracle Instant Client x64 bit 11.2.0.3.

Clean Windows 8 machine (no full blown oracle client installed), only changes are:

Environment variables:
TNS_ADMIN=c:\oracle (here is the TNSNAMES.ORA & SQLNET.ORA)
NLS_LANG=AMERICAN_AMERICA.AL32UTF8
PATH=c:\Oracle\x64;... (there is the x64 bit oracle instant client dlls)

Code: Select all

select id from testtable
works great, id is varchar2(22)

Code: Select all

select ts from testtable
crashes with call stack below, ts is timestamp column


Call stack is:

at OciDynamicType.nativeOCIDescriptorFree(IntPtr , Int32 )
at OciDynamicType.OCIDescriptorFree(IntPtr , Int32 )
at Devart.Data.Oracle.cb.a(IntPtr A_0)
at Devart.Data.Oracle.a9.l()
at Devart.Data.Oracle.a9.a()
at Devart.Data.Oracle.ak.s()
at Devart.Data.Oracle.OracleDataReader.Close()
at Devart.Data.Oracle.OracleDataReader.System.IDisposable.Dispose()
at DevArt.x64.Program.Main(String[] args)

Any help would be really appreciated. We do not welcome direct mode, because of additional configuration troubles.

In x32 mode everything works great. However x32 mode is obsolete for all our code.
by Alladin
Fri 11 May 2012 16:05
Forum: dotConnect for Oracle
Topic: VS11 vs DevArt = Fail on embedding model resources on build
Replies: 7
Views: 1511

Re: VS11 vs DevArt = Fail on embedding model resources on bu

Inner exception is this:

Could not load file or assembly 'Microsoft.Build.Utilities, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

Of course, there is no Microsoft.Build.Utilities, Version 2.0, because I don't have .NET 2.0 installed.

It seems, that support of .NET Framework 4 is not yet fully complete.