Solved

Operation not allowed when the object is closed

Posted on 2014-10-14
4
240 Views
Last Modified: 2014-10-19
We are using a Delphi TClientDataSet to propagate changes from a local database to a remote SQL Server on our website server.  We open the set of records on the local database and open a ClientDataSet with the data from SQL Server.  We compare the two and update the ClientDataSet where required.  These changes are then applied back to the SQL Server database by calling ApplyUpdates.  This has been working fine for a while , but now we are getting the error

Operation not allowed when the object is closed

when attempting to call ApplyUpdates on the ClientDataSet.  No changes have been made to the code or the local environment and we are getting the same error in the development site and on the client's site.

Any ideas!! We are using Delphi 6 and a TADOConnection to the SQLServer, running under Windows 7 Prof 32 bit.

Roger Graham
0
Comment
Question by:rogerfg7
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 34

Expert Comment

by:ste5an
ID: 40379582
D6? Cool. And daring :) Afaik this error means that the connection is no longer active/valid.
0
 
LVL 27

Expert Comment

by:Sinisa Vuk
ID: 40379835
Do you use TSocketConnection component?
Check for property Connected of TSocketConnection before do Apply.
0
 

Accepted Solution

by:
rogerfg7 earned 0 total points
ID: 40380231
ste5an: We're at the cutting edge of antiquated IDEs, besides, we have a long and fruitful relationship.  <Afaik this error means that the connection is no longer active/valid.>  We gathered that from the message, my question is why has this now started happening, presumable some change at the SQL Server end.  Are there any ADO connection parameters or additional code that will get around this.  My understanding of applying updates to a clientdataset/datasetprovider/query is that the whole remote databse process is sorted out via the AS_ApplyUpdates function in the IAppServer interface.

Sinisa Vuk: We are not using a remote server, the ADO query, DateSetProvider and ClientDataSet are all within the app, hence no TSocket in use.

Managed to narrow down the location of the exception to the CommitTrans command on the ADO connection after our updates. As the ApplyUpdates process should handletrnasactions,  I have removed this as it does not seem to affect to update of the server.  So I now regard this question as closed

Many thanks for your comments.
0
 

Author Closing Comment

by:rogerfg7
ID: 40389791
Further investigation showed where the error was being caused and we were able to do a work-around.
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question