Migrating from Delphi 7 to Delpi XE5

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
radub
Posts: 105
Joined: Sat 10 Jul 2010 18:46

Migrating from Delphi 7 to Delpi XE5

Post by radub » Sun 19 Oct 2014 15:41

Hello sir,

We have an n-Tier production application, developed with Delphi 7 along with SDAC latest version.
We try to upgrade the application server tier under Delphi XE5 with the corresponding DACs on Windows 7 64 bit OS.

We encounter 2 problems:
1. Regardless build platform, when trying to update a multiple master-detail structure.
Adding a new record in a detail table - the generated insert query is ok - the detail table is updated;
after that we send a DataRequest to the master table to retrieve the updated structure (master and details); the query which has to get the inserted/updated records from details, doesn't appear immediately, but after 40", and then after each minute; therefor, on the client side it looks like there isn't any modification. The identical source code in Delphi 7, works on production.

Here are the queries from SQL Server Profiler:

Code: Select all

--insert the record into DOCVLN1 table (detail)
BEGIN TRANSACTION 
[...]
exec sp_executesql N'insert into dbo.DOCVLN1
  (LINEORD, DOCID, ITEMID, CCOSTID, DVLN1QTY, DVLN1PUNIT, PRCTVA, DVLN1PUNITDEV, VALTVADEV, UMID, UMFACTOR, XLNID, PVA)
values
  (@P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11, @P12, @P13)',N'@P1 int,@P2 int,@P3 int,@P4 int,@P5 float,@P6 float,@P7 float,@P8 float,@P9 float,@P10 int,@P11 float,@P12 int,@P13 float',2,11652,567,NULL,1,5,24,5,1.2,1,1,0,0
[...]
COMMIT TRANSACTION 

--DataRequest from DOCHD (master table)
SELECT * FROM dbo.DOCHD
WHERE DOCID=11652 

RPC:Completed	exec sp_executesql N'SELECT * FROM dbo.DOCVHD
WHERE DOCID = @P1 ',N'@P1 int',11652	52	2014-10-19 18:14:44.857	0	SferaAppServer.exe	
RPC:Completed	exec sp_executesql N'SELECT * FROM dbo.DOCVLN1
WHERE DOCID = @P1 
ORDER BY DOCID,LINEORD',N'@P1 int',11652	52	2014-10-19 18:14:44.870	0	SferaAppServer.exe	
RPC:Completed	exec sp_executesql N'SELECT * FROM dbo.DOCVHD
WHERE DOCID = @P1 ',N'@P1 int',11652	52	2014-10-19 18:15:44.890	0	SferaAppServer.exe	
RPC:Completed	exec sp_executesql N'SELECT * FROM dbo.DOCVLN1
WHERE DOCID = @P1 
ORDER BY DOCID,LINEORD',N'@P1 int',11652	52	2014-10-19 18:15:44.893	0	SferaAppServer.exe	
RPC:Completed	exec sp_executesql N'SELECT * FROM dbo.DOCVHD
WHERE DOCID = @P1 ',N'@P1 int',11652	52	2014-10-19 18:16:44.890	0	SferaAppServer.exe	
RPC:Completed	exec sp_executesql N'SELECT * FROM dbo.DOCVLN1
WHERE DOCID = @P1 
ORDER BY DOCID,LINEORD',N'@P1 int',11652	52	2014-10-19 18:16:44.903	0	SferaAppServer.exe	
RPC:Completed	exec sp_executesql N'SELECT * FROM dbo.DOCVHD
WHERE DOCID = @P1 ',N'@P1 int',11652	52	2014-10-19 18:17:44.903	0	SferaAppServer.exe	
RPC:Completed	exec sp_executesql N'SELECT * FROM dbo.DOCVLN1
WHERE DOCID = @P1 
ORDER BY DOCID,LINEORD',N'@P1 int',11652	52	2014-10-19 18:17:44.917	0	SferaAppServer.exe
Please notice the time.
It appears that problem is related with one similar on ODAC section.

2. Trying to deploy a 64 bit build test platform to a customer on a windows 2003 x64 bit server, we've got an "Error loading MIDAS.dll", although, we replace the old midas.dll with the 64 bit counterpart; uninstalling the old one, installing the new one no effect.
The 32 bit build has no such error.

Any help would be a big step forward.

Thank you,

Radu B.

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Migrating from Delphi 7 to Delpi XE5

Post by azyk » Wed 22 Oct 2014 13:58

1. We have received your sample for SDAC and reproduced this problem. We will investigate this behavior and inform you about the results.

2. If your application is 32-bit, you should use the 32-bit midas.dll (even if the OS is 64-bit). A 64-bit application requires the 64-bit midas.dll. Please make sure you are deploying a corresponding midas.dll with your application and let us know the results.

Note: the 32-bit version of midas.dll is in the Bin folder; the 64-bit version - in the Bin64 folder relatively to the RAD Studio XE5 installation path. If you deploy midas.dll to the Windows system folder, then in the 64-bit OS the system folder for 64-bit is called System32, and the system folder for 32-bit - SysWOW64.

radub
Posts: 105
Joined: Sat 10 Jul 2010 18:46

Re: Migrating from Delphi 7 to Delpi XE5

Post by radub » Wed 22 Oct 2014 15:36

1. The similar situation with ODAC (I put a topic in the respective forum).
2. I am aware about how to deploy the midas.dll, but even so, doing what you have told me, I get that error. It looks like the application cannot load it. Is there any keys in the registry to be put? similar to "PreferredServerBitness" that informs the server how to react on different platforms.

Any idea?

Thank you,
Radu B.

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Migrating from Delphi 7 to Delpi XE5

Post by azyk » Fri 24 Oct 2014 12:39

radub wrote:2. I am aware about how to deploy the midas.dll, but even so, doing what you have told me, I get that error. It looks like the application cannot load it. Is there any keys in the registry to be put? similar to "PreferredServerBitness" that informs the server how to react on different platforms.
SDAC doesn't require midas.dll for its functioning. Please forward the issue with loading midas.dll to Embarcadero developers.

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Migrating from Delphi 7 to Delpi XE5

Post by azyk » Wed 12 Nov 2014 09:16

1. We have investigated the provided sample and found out that the reason for such behavior is not SDAC, but a bug in several Delphi versions. We can't influence this behavior. A similar report exists in Embarcadero's Quality Central at http://qc.embarcadero.com/wc/qcmain.aspx?d=101264 . You can find a solution for your issue there as well.

radub
Posts: 105
Joined: Sat 10 Jul 2010 18:46

Re: Migrating from Delphi 7 to Delpi XE5

Post by radub » Thu 13 Nov 2014 06:42

It is surprising there is such a bug, which is fundamental functionality; I was also amazed that nobody till now encountered this situation...
Indeed the modifications on DataSnap.Provider.Pas solved the problem.
Case closed.

I'd like to know what platforms are affected by this bug.

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Migrating from Delphi 7 to Delpi XE5

Post by azyk » Fri 14 Nov 2014 08:11

Since this bug is related to RAD Studio, please forward your question to Embarcadero developers.

Post Reply