I'm not sure specifically about your constraint issue, but when I
tried migrating my client/server application from SQL 3.5 / NH to SQL
CE 4.0, I encountered numerous problems. SqlCeLockTimeoutExceptions
where I never had before, errors generating ID column values (below)
and access violations under load. I'm really not doing anything fancy
with NH, but I don't really have time to investigate all these - so I
am just sticking with SQL CE 3.5 for now.

NHibernate.Exceptions.GenericADOException:> could not insert [SQL:
INSERT INTO > ...] --- System.Data.SqlServerCeException: A duplicate
value cannot be inserted into a unique index.

  [4960] 21:55:57.492 Unhandled exception
System.AccessViolationException: Attempted to read or write protected
memory. This is often an indication that other memory is corrupt.
    [4960]    at
System.Data.SqlServerCe.NativeMethodsHelper.delegate_ME_SafeRelease.Invoke(IntPtr&
ppUnknown)
    [4960]    at
System.Data.SqlServerCe.NativeMethodsHelper.SafeRelease(IntPtr&
ppUnknown)
    [4960]    at
System.Data.SqlServerCe.NativeMethods.SafeRelease(IntPtr& ppUnknown)
    [4960]    at
System.Data.SqlServerCe.SqlCeTransaction.ReleaseNativeInterfaces()
    [4960]    at
System.Data.SqlServerCe.SqlCeTransaction.Dispose(Boolean disposing)
    [4960]    at System.Data.SqlServerCe.SqlCeTransaction.Finalize()

Analysing the dump:

    FAULTING_IP:
    kernel32!InterlockedCompareExchange+c
    75a01388 f00fb111        lock cmpxchg dword ptr [ecx],edx

    EXCEPTION_RECORD:  033ef29c -- (.exr 0x33ef29c)
    ExceptionAddress: 75a01388 (kernel32!InterlockedCompareExchange
+0x0000000c)
       ExceptionCode: c0000005 (Access violation)
      ExceptionFlags: 00000000
    NumberParameters: 2
       Parameter[0]: 00000001
       Parameter[1]: 0c5e0014
    Attempt to write to address 0c5e0014


On Feb 4, 3:53 am, EHK <[email protected]> wrote:
> I'm trying to migrate an MVC 2/NHibernate site from using SQLite on
> the development environments to SQL CE 4.
>
....
> So I'm thinking SQL CE 4 has some constraint issues here, but
> shouldn't NHibernate know how to handle them? In my config I'm using
> NHibernate.Dialect.MsSqlCeDialect and the
> NHibernate.Driver.SqlServerCeDriver.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to