hello

i am trying to bulk insert a number of customer-addresses (300)
for test purpose, i created 2 different adresses and duplicated them 150times

now, when i insert the data into crm, i receive 5 times the "sql integrity
violation", the other 295 records are imported correctly

the data is inserted with the WebService from a Windows Application, the
WebService is invoked with integrated security and unsafeconnectionsharing, 2
threads import parallel

i turned on verbose logging and isolated one error, but it does not give me
clue
any hints?

-- logfile --
[2007-11-27 17:27:07.558] Process:w3wp |Thread:7480 |Category: Unmanaged.Sql
|User: PlatformUser |Level: Verbose |
COLEDataAccess::ExecuteParameterizedQuery File:
c:\crmv3rtm\src\platform\include\omcommon\dataaccess.inl Line: 820
>!!insert into CustomerAddressBase( CustomerAddressId,Name,City,ObjectTypeCode,Line1,Telephone1,PostalCode,ParentId,Country,CreatedBy,ModifiedBy,AddressNumber,CreatedOn,ModifiedOn,DeletionStateCode) values ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)!!{648D0998-059D-DC11-92F0-000D601647DB}::real data here::real data here::1::real data here::real data here::real data here::{E6670C72-E336-DC11-B130-000D601647DB}::real data here::{6F5D38AB-D436-DC11-B130-000D601647DB}::{6F5D38AB-D436-DC11-B130-000D601647DB}::7::2007-11-27T16:27:07Z::2007-11-27T16:27:07Z::0!!
[2007-11-27 17:27:07.574] Process:w3wp |Thread:7480 |Category:
Unmanaged.Platform |User: PlatformUser |Level: Error |
COLEDataAccess::ExecuteParameterizedQuery File:
c:\crmv3rtm\src\platform\include\omcommon\dataaccess.inl Line: 823
>hr = 0x80040e2f
[2007-11-27 17:27:07.574] Process:w3wp |Thread:7480 |Category:
Unmanaged.Platform |User: PlatformUser |Level: Error |
COLEDataAccess::ExecuteParameterizedQuery File:
c:\crmv3rtm\src\platform\include\omcommon\dataaccess.inl Line: 825
>Call to COleRecordSet::Open() failed. Query = insert into CustomerAddressBase( CustomerAddressId,Name,City,ObjectTypeCode,Line1,Telephone1,PostalCode,ParentId,Country,CreatedBy,ModifiedBy,AddressNumber,CreatedOn,ModifiedOn,DeletionStateCode) values ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) Error = 0x80040e2f
[2007-11-27 17:27:07.590] Process:w3wp |Thread:7480 |Category:
Unmanaged.Platform |User: PlatformUser |Level: Error |
InternalCrmSetErrorInfo File:
c:\crmV3RTM\src\platform\include\Util\ICrmError.h Line: 362
><description>Operation failed due to a SQL integrity violation.</description><file>c:\crmv3rtm\src\platform\include\omcommon\dataaccess.inl</file><line>441</line>




[2007-11-27 17:27:07.6] Process: w3wp |Thread: 7480 |Category: Exception
|User: 6f5d38ab-d436-dc11-b130-000d601647db |Level: Error |
CrmSoapExtension.GetCrmException
at CrmSoapExtension.GetCrmException(Exception exception)
at CrmSoapExtension.GetCrmException(Exception exception)
at CrmSoapExtension.GetCrmException(Exception exception)
at CrmSoapExtension.ProcessMessage(SoapMessage message)
at SoapMessage.RunExtensions(SoapExtension[] extensions)
at SoapServerProtocol.WriteException(Exception e, Stream outputStream)
at WebServiceHandler.WriteException(Exception e)
at WebServiceHandler.Invoke()
at WebServiceHandler.CoreProcessRequest()
at SyncSessionlessHandler.ProcessRequest(HttpContext context)
at
CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
at HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)
at HttpApplication.ResumeSteps(Exception error)
at
HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext
context, AsyncCallback cb, Object extraData)
at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
at HttpRuntime.ProcessRequest(HttpWorkerRequest wr)
at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)
>Crm Exception: Message: , ErrorCode: -2147220937, InnerException: System.Runtime.InteropServices.COMException (0x80040237): Ausnahme von HRESULT: 0x80040237.
at
Microsoft.Crm.Platform.ComProxy.CRMCustomerAddressClass.Create(CUserAuth&
Caller, String EntityXML)
[2007-11-27 17:27:07.6] Process: w3wp |Thread: 7480 |Category: Platform
|User: 6f5d38ab-d436-dc11-b130-000d601647db |Level: Error |
CrmSoapExtension.ProcessMessage
>CrmSoapExtension detected CrmException:
System.Web.Services.Protocols.SoapException: Der Server konnte die
Anforderung nicht verarbeiten. --->
System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen
Ausnahmefehler verursacht. ---> System.Runtime.InteropServices.COMException
(0x80040237): Ausnahme von HRESULT: 0x80040237.
at
Microsoft.Crm.Platform.ComProxy.CRMCustomerAddressClass.Create(CUserAuth&
Caller, String EntityXML)
--- Ende der internen Ausnahmestapel�¼berwachung ---
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess)
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture, Boolean verifyAccess)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.Crm.Sdk.UnmanagedServiceProvider.ExecuteInternal(Object
comProvider, String method, Object[] methodParameters)
at
Microsoft.Crm.Sdk.UnmanagedServiceProvider.InternalCreate(IBusinessEntity
entity, ExecutionContext context)
at Microsoft.Crm.Sdk.UnmanagedServiceProvider.Create(IBusinessEntity
entity, ExecutionContext context)
at Microsoft.Crm.WebServices.CrmService.Create(BusinessEntity entity)
--- Ende der internen Ausnahmestapel�¼berwachung ---

RE: SQL Integrity Violation; 0x80040e2f; bulk insert customeraddress by mscrmexpert

mscrmexpert
Tue Nov 27 22:30:00 PST 2007

have you installed the rollup update 2.?

it seems having limited record update for bulk import.

--
Regards,

MS CRM Certified Professional

http://microsoftcrm3.blogspot.com

Chat with me on MSN / Gmail / Skype : ID Is :.. mscrmexpert@gmail.com



"Friedl2000" wrote:

> hello
>
> i am trying to bulk insert a number of customer-addresses (300)
> for test purpose, i created 2 different adresses and duplicated them 150times
>
> now, when i insert the data into crm, i receive 5 times the "sql integrity
> violation", the other 295 records are imported correctly
>
> the data is inserted with the WebService from a Windows Application, the
> WebService is invoked with integrated security and unsafeconnectionsharing, 2
> threads import parallel
>
> i turned on verbose logging and isolated one error, but it does not give me
> clue
> any hints?
>
> -- logfile --
> [2007-11-27 17:27:07.558] Process:w3wp |Thread:7480 |Category: Unmanaged.Sql
> |User: PlatformUser |Level: Verbose |
> COLEDataAccess::ExecuteParameterizedQuery File:
> c:\crmv3rtm\src\platform\include\omcommon\dataaccess.inl Line: 820
> >!!insert into CustomerAddressBase( CustomerAddressId,Name,City,ObjectTypeCode,Line1,Telephone1,PostalCode,ParentId,Country,CreatedBy,ModifiedBy,AddressNumber,CreatedOn,ModifiedOn,DeletionStateCode) values ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)!!{648D0998-059D-DC11-92F0-000D601647DB}::real data here::real data here::1::real data here::real data here::real data here::{E6670C72-E336-DC11-B130-000D601647DB}::real data here::{6F5D38AB-D436-DC11-B130-000D601647DB}::{6F5D38AB-D436-DC11-B130-000D601647DB}::7::2007-11-27T16:27:07Z::2007-11-27T16:27:07Z::0!!
> [2007-11-27 17:27:07.574] Process:w3wp |Thread:7480 |Category:
> Unmanaged.Platform |User: PlatformUser |Level: Error |
> COLEDataAccess::ExecuteParameterizedQuery File:
> c:\crmv3rtm\src\platform\include\omcommon\dataaccess.inl Line: 823
> >hr = 0x80040e2f
> [2007-11-27 17:27:07.574] Process:w3wp |Thread:7480 |Category:
> Unmanaged.Platform |User: PlatformUser |Level: Error |
> COLEDataAccess::ExecuteParameterizedQuery File:
> c:\crmv3rtm\src\platform\include\omcommon\dataaccess.inl Line: 825
> >Call to COleRecordSet::Open() failed. Query = insert into CustomerAddressBase( CustomerAddressId,Name,City,ObjectTypeCode,Line1,Telephone1,PostalCode,ParentId,Country,CreatedBy,ModifiedBy,AddressNumber,CreatedOn,ModifiedOn,DeletionStateCode) values ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) Error = 0x80040e2f
> [2007-11-27 17:27:07.590] Process:w3wp |Thread:7480 |Category:
> Unmanaged.Platform |User: PlatformUser |Level: Error |
> InternalCrmSetErrorInfo File:
> c:\crmV3RTM\src\platform\include\Util\ICrmError.h Line: 362
> ><description>Operation failed due to a SQL integrity violation.</description><file>c:\crmv3rtm\src\platform\include\omcommon\dataaccess.inl</file><line>441</line>
>
>
>
>
> [2007-11-27 17:27:07.6] Process: w3wp |Thread: 7480 |Category: Exception
> |User: 6f5d38ab-d436-dc11-b130-000d601647db |Level: Error |
> CrmSoapExtension.GetCrmException
> at CrmSoapExtension.GetCrmException(Exception exception)
> at CrmSoapExtension.GetCrmException(Exception exception)
> at CrmSoapExtension.GetCrmException(Exception exception)
> at CrmSoapExtension.ProcessMessage(SoapMessage message)
> at SoapMessage.RunExtensions(SoapExtension[] extensions)
> at SoapServerProtocol.WriteException(Exception e, Stream outputStream)
> at WebServiceHandler.WriteException(Exception e)
> at WebServiceHandler.Invoke()
> at WebServiceHandler.CoreProcessRequest()
> at SyncSessionlessHandler.ProcessRequest(HttpContext context)
> at
> CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
> at HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
> completedSynchronously)
> at HttpApplication.ResumeSteps(Exception error)
> at
> HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext
> context, AsyncCallback cb, Object extraData)
> at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
> at HttpRuntime.ProcessRequest(HttpWorkerRequest wr)
> at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)
> >Crm Exception: Message: , ErrorCode: -2147220937, InnerException: System.Runtime.InteropServices.COMException (0x80040237): Ausnahme von HRESULT: 0x80040237.
> at
> Microsoft.Crm.Platform.ComProxy.CRMCustomerAddressClass.Create(CUserAuth&
> Caller, String EntityXML)
> [2007-11-27 17:27:07.6] Process: w3wp |Thread: 7480 |Category: Platform
> |User: 6f5d38ab-d436-dc11-b130-000d601647db |Level: Error |
> CrmSoapExtension.ProcessMessage
> >CrmSoapExtension detected CrmException:
> System.Web.Services.Protocols.SoapException: Der Server konnte die
> Anforderung nicht verarbeiten. --->
> System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen
> Ausnahmefehler verursacht. ---> System.Runtime.InteropServices.COMException
> (0x80040237): Ausnahme von HRESULT: 0x80040237.
> at
> Microsoft.Crm.Platform.ComProxy.CRMCustomerAddressClass.Create(CUserAuth&
> Caller, String EntityXML)
> --- Ende der internen Ausnahmestapel�¼berwachung ---
> at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
> BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
> culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess)
> at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
> BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
> culture, Boolean verifyAccess)
> at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
> invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
> at Microsoft.Crm.Sdk.UnmanagedServiceProvider.ExecuteInternal(Object
> comProvider, String method, Object[] methodParameters)
> at
> Microsoft.Crm.Sdk.UnmanagedServiceProvider.InternalCreate(IBusinessEntity
> entity, ExecutionContext context)
> at Microsoft.Crm.Sdk.UnmanagedServiceProvider.Create(IBusinessEntity
> entity, ExecutionContext context)
> at Microsoft.Crm.WebServices.CrmService.Create(BusinessEntity entity)
> --- Ende der internen Ausnahmestapel�¼berwachung ---
>

RE: SQL Integrity Violation; 0x80040e2f; bulk insert customeraddre by Friedl2000

Friedl2000
Wed Nov 28 07:29:02 PST 2007

yes, rollup 2 is installed

i investigated the problem further with sql profiler and it seems that the
next available adressnumber is not generated in a threadsafe way, so when
more threads try to create adresses with the same account, they may select
the same number and one of them will fail with the insert statement due to an
index violation


"Imran" wrote:

> have you installed the rollup update 2.?
>
> it seems having limited record update for bulk import.
>
> --
> Regards,
>
> MS CRM Certified Professional
>
> http://microsoftcrm3.blogspot.com
>
> Chat with me on MSN / Gmail / Skype : ID Is :.. mscrmexpert@gmail.com
>
>
>
> "Friedl2000" wrote:
>
> > hello
> >
> > i am trying to bulk insert a number of customer-addresses (300)
> > for test purpose, i created 2 different adresses and duplicated them 150times
> >
> > now, when i insert the data into crm, i receive 5 times the "sql integrity
> > violation", the other 295 records are imported correctly
> >
> > the data is inserted with the WebService from a Windows Application, the
> > WebService is invoked with integrated security and unsafeconnectionsharing, 2
> > threads import parallel
> >
> > i turned on verbose logging and isolated one error, but it does not give me
> > clue
> > any hints?
> >
> > -- logfile --
> > [2007-11-27 17:27:07.558] Process:w3wp |Thread:7480 |Category: Unmanaged.Sql
> > |User: PlatformUser |Level: Verbose |
> > COLEDataAccess::ExecuteParameterizedQuery File:
> > c:\crmv3rtm\src\platform\include\omcommon\dataaccess.inl Line: 820
> > >!!insert into CustomerAddressBase( CustomerAddressId,Name,City,ObjectTypeCode,Line1,Telephone1,PostalCode,ParentId,Country,CreatedBy,ModifiedBy,AddressNumber,CreatedOn,ModifiedOn,DeletionStateCode) values ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)!!{648D0998-059D-DC11-92F0-000D601647DB}::real data here::real data here::1::real data here::real data here::real data here::{E6670C72-E336-DC11-B130-000D601647DB}::real data here::{6F5D38AB-D436-DC11-B130-000D601647DB}::{6F5D38AB-D436-DC11-B130-000D601647DB}::7::2007-11-27T16:27:07Z::2007-11-27T16:27:07Z::0!!
> > [2007-11-27 17:27:07.574] Process:w3wp |Thread:7480 |Category:
> > Unmanaged.Platform |User: PlatformUser |Level: Error |
> > COLEDataAccess::ExecuteParameterizedQuery File:
> > c:\crmv3rtm\src\platform\include\omcommon\dataaccess.inl Line: 823
> > >hr = 0x80040e2f
> > [2007-11-27 17:27:07.574] Process:w3wp |Thread:7480 |Category:
> > Unmanaged.Platform |User: PlatformUser |Level: Error |
> > COLEDataAccess::ExecuteParameterizedQuery File:
> > c:\crmv3rtm\src\platform\include\omcommon\dataaccess.inl Line: 825
> > >Call to COleRecordSet::Open() failed. Query = insert into CustomerAddressBase( CustomerAddressId,Name,City,ObjectTypeCode,Line1,Telephone1,PostalCode,ParentId,Country,CreatedBy,ModifiedBy,AddressNumber,CreatedOn,ModifiedOn,DeletionStateCode) values ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) Error = 0x80040e2f
> > [2007-11-27 17:27:07.590] Process:w3wp |Thread:7480 |Category:
> > Unmanaged.Platform |User: PlatformUser |Level: Error |
> > InternalCrmSetErrorInfo File:
> > c:\crmV3RTM\src\platform\include\Util\ICrmError.h Line: 362
> > ><description>Operation failed due to a SQL integrity violation.</description><file>c:\crmv3rtm\src\platform\include\omcommon\dataaccess.inl</file><line>441</line>
> >
> >
> >
> >
> > [2007-11-27 17:27:07.6] Process: w3wp |Thread: 7480 |Category: Exception
> > |User: 6f5d38ab-d436-dc11-b130-000d601647db |Level: Error |
> > CrmSoapExtension.GetCrmException
> > at CrmSoapExtension.GetCrmException(Exception exception)
> > at CrmSoapExtension.GetCrmException(Exception exception)
> > at CrmSoapExtension.GetCrmException(Exception exception)
> > at CrmSoapExtension.ProcessMessage(SoapMessage message)
> > at SoapMessage.RunExtensions(SoapExtension[] extensions)
> > at SoapServerProtocol.WriteException(Exception e, Stream outputStream)
> > at WebServiceHandler.WriteException(Exception e)
> > at WebServiceHandler.Invoke()
> > at WebServiceHandler.CoreProcessRequest()
> > at SyncSessionlessHandler.ProcessRequest(HttpContext context)
> > at
> > CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
> > at HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
> > completedSynchronously)
> > at HttpApplication.ResumeSteps(Exception error)
> > at
> > HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext
> > context, AsyncCallback cb, Object extraData)
> > at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
> > at HttpRuntime.ProcessRequest(HttpWorkerRequest wr)
> > at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)
> > >Crm Exception: Message: , ErrorCode: -2147220937, InnerException: System.Runtime.InteropServices.COMException (0x80040237): Ausnahme von HRESULT: 0x80040237.
> > at
> > Microsoft.Crm.Platform.ComProxy.CRMCustomerAddressClass.Create(CUserAuth&
> > Caller, String EntityXML)
> > [2007-11-27 17:27:07.6] Process: w3wp |Thread: 7480 |Category: Platform
> > |User: 6f5d38ab-d436-dc11-b130-000d601647db |Level: Error |
> > CrmSoapExtension.ProcessMessage
> > >CrmSoapExtension detected CrmException:
> > System.Web.Services.Protocols.SoapException: Der Server konnte die
> > Anforderung nicht verarbeiten. --->
> > System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen
> > Ausnahmefehler verursacht. ---> System.Runtime.InteropServices.COMException
> > (0x80040237): Ausnahme von HRESULT: 0x80040237.
> > at
> > Microsoft.Crm.Platform.ComProxy.CRMCustomerAddressClass.Create(CUserAuth&
> > Caller, String EntityXML)
> > --- Ende der internen Ausnahmestapel�¼berwachung ---
> > at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
> > BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
> > culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess)
> > at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
> > BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
> > culture, Boolean verifyAccess)
> > at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
> > invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
> > at Microsoft.Crm.Sdk.UnmanagedServiceProvider.ExecuteInternal(Object
> > comProvider, String method, Object[] methodParameters)
> > at
> > Microsoft.Crm.Sdk.UnmanagedServiceProvider.InternalCreate(IBusinessEntity
> > entity, ExecutionContext context)
> > at Microsoft.Crm.Sdk.UnmanagedServiceProvider.Create(IBusinessEntity
> > entity, ExecutionContext context)
> > at Microsoft.Crm.WebServices.CrmService.Create(BusinessEntity entity)
> > --- Ende der internen Ausnahmestapel�¼berwachung ---
> >