Unitable Problem with .post and .delete

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
DiRi
Posts: 2
Joined: Tue 18 Jun 2013 09:05

Unitable Problem with .post and .delete

Post by DiRi » Tue 18 Jun 2013 09:42

After upgrading UNIDAC components to version 5 there are several problems with my delhi-6 application, which was working fine with UNIDAC version 4x. I get Access-Violations whenever posting data or deleting in UniTables connected to Firebird 2.5. It seems, LOCKMODE is responsible for that: Always my unitable's Lockmode setting is lmOptimistic (the default). Changig the settings to LMNONE the program is executed without Errors - but as far I understand the functionality of the lockmode-Option, this can't be a solution for a multi-user-application.
Which changings do I have to do in my source?
Thanks for any hint and help in advance
DiRi

AndreyZ

Re: Unitable Problem with .post and .delete

Post by AndreyZ » Wed 19 Jun 2013 14:19

Thank you for the information. We have fixed this problem. This fix will be included in the next UniDAC build.
If you have UniDAC source code, you should change the implementation of the TGDSTransaction.ExecuteImmediate method in the IBCClassesUni unit to the following:

Code: Select all

procedure TGDSTransaction.ExecuteImmediate(const SQL: string);
var
{$IFDEF NEXTGEN}
  ASQL: AnsiString;
{$ENDIF}
  PSQL: IntPtr;
  Conn: TGDSConnection;
  Res: ISC_STATUS;
  i: integer;
begin
{$IFDEF NEXTGEN}
  ASQL := AnsiString(SQL);
  PSQL := Marshal.StringToHGlobalAnsi(ASQL);
{$ELSE}
  PSQL := Marshal.StringToHGlobalAnsi(AnsiString(SQL));
{$ENDIF}  
  try
    for i := 0 to FConnections.Count - 1 do begin
      Conn := TGDSConnection(FConnections[i]);
      GDS.Busy;
      Res := GDS.isc_dsql_execute_immediate(FStatusVector, Conn.FDatabaseHandle,
        FTransactionHandle, 0, PSQL, Conn.FSQLDialect, nil);
      GDS.Release;
      Check(Res);
    end;
  finally
    Marshal.FreeCoTaskMem(PSQL);
  end;
end;

DiRi
Posts: 2
Joined: Tue 18 Jun 2013 09:05

Re: Unitable Problem with .post and .delete

Post by DiRi » Thu 20 Jun 2013 07:34

Hello Andrey,
thank you for your reply. I didn't purchase the UNIDAC sources, however I do need the functioning UniTable because my customers expect a long-announced version of my product. How long do i have to wait for then next build? Please suggest what to do..
Best regards and thanks again

AndreyZ

Re: Unitable Problem with .post and .delete

Post by AndreyZ » Thu 20 Jun 2013 08:16

We plan to release all DAC products next month. But if you need this fix as soon as possible, I can send you a custom UniDAC build with this fix. Please send your UniDAC license number to andreyz*devart*com.

Post Reply