Solved

Operation not allowed when the object is closed

Posted on 2014-10-14
4
195 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
  • 2
4 Comments
 
LVL 33

Expert Comment

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

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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Params not declared?  T-SQL syntax question 3 38
Need Help Delphi 2010 CheckBox1 Stored value in memo 13 55
CROSS APPLY 4 43
SQL Server Question 5 25
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.
A short film showing how OnPage and Connectwise integration works.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

930 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now