Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Operation not allowed when the object is closed

Posted on 2014-10-14
4
Medium Priority
?
263 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 35

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

670 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