• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1906
  • Last Modified:

Delphi Datasnap ADO Refresh problems


Hi,

I am creating a multi-tier database application using DCOM Remote datamodules.

The server-tier connects to a MS SQL database using ADO Connections; A number of ADOQueries and ADOTables are present, which are all exported by DataSetProvider components.

The client-tier connects to the remote data module using a DCOMConnection. All by the Server's Remote Datamodule exported DataSets are imported by CliendDataSet components.


And here is the problem:

When a client is running, and I change a record in the database by hand, the ClientDataSet components connecting to ADOQueries do refresh correctly when I call Refresh().

However, the ClientDataSets components connecting to the ADOTables DO NOT refresh correctly when I call Refresh(). Even Close() followed by Open() do not result in the correct recordset. The only way to fetch the correct recordset was to open and close the DCOMConnection....that is not the way it is supposed to work, is it?

The Borland FAQ says you should get to see changes made by other users when you apply updates:

ClientDataSet1.ApplyUpdates(-1);
ClientDataSet1.Refresh();

Apparently, this does not work (At least not in my scenario). It seems like the server denies to send a new recordset to the client when a Refresh is called....

I suspect the CursorType property of the TADOTable on the server has something to do with it. If I correctly understand the help section, it should be set to 'ctDynamic' instead of 'ctKeyset'. However, ctDynamic is only effective when CursorLocation is set to clUseServer instead of (the default) clUseClient.

Can anybody help me out?
0
MaximumCarnage
Asked:
MaximumCarnage
  • 3
  • 3
1 Solution
 
miroslavpCommented:
Hi,

Why you use TADOTable components? Use TADOQuery! You can read anywhere in the Borland's help that TxxxTable (TADOTable, TTable, TIBTable) components are mainly designed for desktop applications.

TIA,
Miro.
0
 
mick3yCommented:
Ok, you have a client-server application and your databse is on the server, correct? If so, try using TRANSACTIONS. See delphi help, there is one example that pictures your situation and if that does not work, try to figure how are you using the file "Pdoxusrs.net". This file is the one that carries all the data changes of your database, you must SUBMIT the changes.
0
 
miroslavpCommented:
Hi,

Conversation is about MS SQL Server and ADO. What "pdoxusrs.net"?!? There is nothing about Paradox or BDE.

TIA,
Miro.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
MaximumCarnageAuthor Commented:

OK, using TADOQuery components instead of TADOTable is possible (I tried it for a moment before posting this question), but then other issues arise when updating a record by means of a ClientDataSet:

Exceptions are thrown that mention "Bookmark not found" or "No index specified".

Are there any specific points I forgot about? (I'm using data bound controls to insert / update a record).

0
 
MaximumCarnageAuthor Commented:

OK, using TADOQuery components instead of TADOTable is possible (I tried it for a moment before posting this question), but then other issues arise when updating a record by means of a ClientDataSet:

Exceptions are thrown that mention "Bookmark not found" or "No index specified".

Are there any specific points I forgot about? (I'm using data bound controls to insert / update a record).

0
 
miroslavpCommented:
Hi,

There are many issues about ADOExpress in Delphi. Some of problems come from not quite good realization of ADOExpress components (I heard many good words about TBetterADODataSet, where author has fixed many issues), but the most problems come from MS ADO itself :(, especially in updates. I have very much problems and in most of cases there is no any “recipe” for problems in ADOExpress and MS ADO.
I have applications similar to your (except that I use IBX and Interbase) and I tell to my DataSet provider to apply updates directly to database (to skip the underlying DataSet component – in your case TADOQuery).
How you make updates? Are you trying directly updates? (I am not sure that they are applicable to ADOExpress).

TIA,
Miro.
0
 
MaximumCarnageAuthor Commented:


Well, so far it works but I am sure I will encounter some problems :)

Untill then, thanks and I get back to you.
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now