BEGIN TRAN perform the job COMMITWhen 3 clients worked: => @@TRANCOUNT=3.
Situation 1: Client 1 end correctly => SQLCOMMIT() => @@TRANCOUNT=2. Client 2 end correctly => SQLCOMMIT() => @@TRANCOUNT=1. Client 3 end correctly => SQLCOMMIT() => @@TRANCOUNT=0 => SQL Server COMMIT the job. Situation 2: Client 1 end correctly => SQLCOMMIT() => @@TRANCOUNT=2. Client 2 end not correctly ( no action ) => @@TRANCOUNT=2. Client 3 end correctly => SQLCOMMIT() => @@TRANCOUNT=1 => Disconnection => SQL Server ROLLBACK the job. Situation 3: Client 1 end correctly => SQLCOMMIT() => @@TRANCOUNT=2. Client 2 end not correctly and SQLDISCONNECT() send a SQLROLLBACK() => SQL Server rollback all, and Client 3 can go out of control.Hovewer, SQLDISCONNECT() can perform SQLROLLBACK() only is VFP control the
* for default SQLDISCONNECT send SQLROLLBACK() =SQLSETPROPERTY(con,"AutoRollback",.T.) * choice of developer =SQLSETPROPERTY(con,"AutoRollback",.F.) * SQLDISCONNECT send nothingFabio