[fdo-users] autocad 2011 commit changes problem

vasjalebar vasjalebar at gmail.com
Thu Mar 17 07:01:55 EDT 2011


Hi,
I have developed an application that synchronizes SQL tables (mssql 2008 R2)
over WCF (using MS sync framework 2.1). This application requires triggers
(insert, update and delete) on tables one wishes to synchronize. And this
causes a problem. If I want to commit more than one change (insert, update
or delete) in Autocad 2011 the FDO provider (ms sql spatial) throws this
error:
- 1= Failed to insert feature.
- 2 = RDBMS: [Microsoft][ODBC SQL Server Driver]Neveljavno stanje kazalke.*
- 3 = RDBMS: [Microsoft][ODBC SQL Server Driver]Neveljavno stanje kazalke.*
Feature was not processed becouse operation has been terminated prematurely.
(2 consecutive occurrences)
* this is an error in slovene and it means something like "Invalid state of
the cursor"

If I disable the trigger, commit works, but if the trigger is enabled I
always get this error (if I commit more than one change). The code behind
the insert trigger (tried it just for this example) is:
CREATE TRIGGER [dbo].[trg_insert]
   ON  [dbo].[oc]
   AFTER insert
AS 
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	SELECT 1;
    -- Insert statements for trigger here

END

The triggers I use in the application is a bit more complicated and are a
bit to long :)


The next thing I checked was the code of fdo provider. I found that the
provider uses SQL_CURSOR_STATIC (in
Providers\GenericRdbms\Src\ODBCDriver\connect.c).
So my question is what if I change SQL_CURSOR_STATIC to SQL_CURSOR_DYNAMIC?
Is this the right approach for this problem??? And if anyone wants to know,
I HAVE TO USE TRIGGERS :)

Best regards,
Vasja Lebar



--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/autocad-2011-commit-changes-problem-tp6180452p6180452.html
Sent from the FDO Users mailing list archive at Nabble.com.


More information about the fdo-users mailing list