Board index » delphi » Stored Procedure not finding matching Blob that was already added
Brian Thomas
![]() Delphi Developer |
Stored Procedure not finding matching Blob that was already added2005-01-07 05:35:31 AM delphi45 This is going to take a little explaining... I have a program whose datamodule contains nested datasets. E.g., I am using TSQLDatasets with a provider, client datasets, and datasources for my data nesting. I also have a TSQLStoredProcedure connected to my database's stored procedure which searches through records trying to find Blobs with matching data. The table it searches through, we'll call the table "INFO", is the database table that one of the nested datasets represents. My algorithm goes something like this: I have a new piece of data which I pass into the stored procedure, the stored procedure searches the "INFO" tables' Blobs to find matching data, if matching data isn't found, it returns -1, otherwise, it returns the Primary Key ID of the matching "INFO" record. If I receive a -1 from the stored procedure, I add a new record to the "INFO" client dataset and I add the new data into the new record's Blob field ( I then apply updates ), otherwise, I use the returned key id for other processing. I may perform this operation with several loops of different new/matching data and the stored procedure consistently finds the matching Blob data even after creating the new record and applying updates. However... If I have another application ( on my computer or another computer ) that is connected to the same database it will not find the newly created matching Blob data in the "INFO" table anymore. I have been able to replicate this inconsistent behavior as follows: I can create a new application and add to its form an SQLConnection, TSQLDataset, and a TDatabaseProvider, and open the SQLDataset in the new application. It is only when the TDatabaseProvider is added to the other new application and the Dataset is opened that my program's stored procedure will begin to fail finding the matching Blob. It will only begin working once I close the new application's SQLConnection. Please help. I'm using the default properties for the provider except I am cascading deletes and adds, and I have the UpdateWhereKeyOnly for my update mode. I have changed the update mode to where changed and that still didn't work. I am also using the default parameters for the sqlconnection but I have set commitretaining to false and that doesn't work either. Thank you. Brian Thomas |