Datasnap + Remobjects SDK
- 
				hmelihkara
 - Posts: 21
 - Joined: Fri 09 Nov 2007 23:29
 
Datasnap + Remobjects SDK
Hi,
I've a basic datasnap server / client with Remobjects Datasnap module.
Everything seems working normal till try to update some data.
I edit data from client and post it. After that I need to applyupdates(-1); to apply updates to server but I got:
An exception was raised on the server: One of the connections in the transaction is not active.
When I change SDAC(v 6.1.4) components with ADO ones. Update happens and works without any problems.
Is there any workaround about this. I also check the midas demo for any special commands, etc... but nothing.
on Datasnap module I simply have:
TMSConnection
TMSQuery
TDatasetProvider
Thanks...
			
									
									
						I've a basic datasnap server / client with Remobjects Datasnap module.
Everything seems working normal till try to update some data.
I edit data from client and post it. After that I need to applyupdates(-1); to apply updates to server but I got:
An exception was raised on the server: One of the connections in the transaction is not active.
When I change SDAC(v 6.1.4) components with ADO ones. Update happens and works without any problems.
Is there any workaround about this. I also check the midas demo for any special commands, etc... but nothing.
on Datasnap module I simply have:
TMSConnection
TMSQuery
TDatasetProvider
Thanks...
- 
				AndreyZ
 
Hello,
Such problem occurs on working with transaction used by several connections, some of which are not active. Please check if the problem persists when you are not using RemObjects components.
Also, you can try creating a small sample to demonstrate the problem and send it to andreyz*devart*com.
			
									
									
						Such problem occurs on working with transaction used by several connections, some of which are not active. Please check if the problem persists when you are not using RemObjects components.
Also, you can try creating a small sample to demonstrate the problem and send it to andreyz*devart*com.
- 
				AndreyZ
 
I have investigated your sample. The point is that the TROClassFactory class destroys TRODataSnapModule after roundtrip to the server is finished, and creates it again when client application sends data to the server. In this case, the TMSConnection component is inactive (because it has just been created ), and there is an attempt to start a transaction using this inactive TMSConnection component. This causes the "One of the connections in the transaction is not active" error. To solve the problem, you should use another factory class that doesn't recreate instances for each roundtrip. For more information, please consult with RemObjects developers.
			
									
									
						- 
				hmelihkara
 - Posts: 21
 - Joined: Fri 09 Nov 2007 23:29
 
Thanks Andrey,
I've already had opened case with the issue:
http://connect.remobjects.com/discussio ... e-datasnap
Thanks for your helps.
			
									
									
						I've already had opened case with the issue:
http://connect.remobjects.com/discussio ... e-datasnap
Thanks for your helps.
Re: Datasnap + Remobjects SDK
I know it's 12 months later Andrey, but your answer also directly helped me understand the same error. 
We're also using Remobjects, but already using a TROPerClientClassFactory. The problem was basically the same though. The TROPerClientClassFactory was being destoryed on the server, the client later made a call, creating a new one. The first call made on the new class factory instance was the .StartTransaction on a non active TMSConnection.
Our underlying problem is one of not being stateless, which is an architectual issue going back over 10 years now...
Paul.
			
									
									
						We're also using Remobjects, but already using a TROPerClientClassFactory. The problem was basically the same though. The TROPerClientClassFactory was being destoryed on the server, the client later made a call, creating a new one. The first call made on the new class factory instance was the .StartTransaction on a non active TMSConnection.
Our underlying problem is one of not being stateless, which is an architectual issue going back over 10 years now...
Paul.
- 
				wishmaster
 - Posts: 8
 - Joined: Sat 26 Apr 2014 19:00
 
Re: Datasnap + Remobjects SDK
And I know it's 10 months later but...
I'm having problems with RO-SDK + Datasnap.
I've simple query like "SELECT * FROM SOMETABLE" on the server side.
When I change something on the client side and applyupdates. It seems like changes are applied but when I close the form / application and re-open it. Data still unchanged standing there. I try many things but can't make it work. Also I havent got any problems with TROClassFactories it's set to not close till no transaction happens for 30 minutes.
So do I have to write some special update, delete, insert queries? Because when I change components with ADO they works...
Thanks
			
									
									
						I'm having problems with RO-SDK + Datasnap.
I've simple query like "SELECT * FROM SOMETABLE" on the server side.
When I change something on the client side and applyupdates. It seems like changes are applied but when I close the form / application and re-open it. Data still unchanged standing there. I try many things but can't make it work. Also I havent got any problems with TROClassFactories it's set to not close till no transaction happens for 30 minutes.
So do I have to write some special update, delete, insert queries? Because when I change components with ADO they works...
Thanks
Re: Datasnap + Remobjects SDK
Hello, 
We couldn't reproduce the problem. Please send us a complete small test project to reproduce the problem.
			
									
									
						We couldn't reproduce the problem. Please send us a complete small test project to reproduce the problem.
- 
				wishmaster
 - Posts: 8
 - Joined: Sat 26 Apr 2014 19:00
 
Re: Datasnap + Remobjects SDK
Hi,I've found the cause but can't find a proper solution.
When I wrote to the server query:
I can edit records from client side and when applied everything is perfect.
But when I wrote to the server query:
Changes are not reflected to the database.
Thanks
Edit: Filling the SQLUpdate simply solve the problem.
			
									
									
						When I wrote to the server query:
Code: Select all
SELECT * FROM tblCUSTOMER WHERE CustomerGroup='TEST'But when I wrote to the server query:
Code: Select all
SELECT *, Available=Balance+Credit FROM tblCUSTOMER WHERE CustomerGroup='TEST'Thanks
Edit: Filling the SQLUpdate simply solve the problem.
Re: Datasnap + Remobjects SDK
Hello, 
To solve the problem, you can set the TMSQuery.Options.SetFieldsReadOnly property to True - then ReadOnly property will be set to True for all the fields, that are absent in UpdatingTable. More details about SetFieldsReadOnly can be found at http://www.devart.com/sdac/docs/index.h ... adonly.htm
			
									
									
						To solve the problem, you can set the TMSQuery.Options.SetFieldsReadOnly property to True - then ReadOnly property will be set to True for all the fields, that are absent in UpdatingTable. More details about SetFieldsReadOnly can be found at http://www.devart.com/sdac/docs/index.h ... adonly.htm