Prevent TUniQuery delete without SQLDelete filled + TUniTransaction DefaultCloseAction behaviour

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
tcxbalage
Posts: 23
Joined: Sat 04 Apr 2020 10:45

Prevent TUniQuery delete without SQLDelete filled + TUniTransaction DefaultCloseAction behaviour

Post by tcxbalage » Sat 31 Oct 2020 14:33

hello,

I'm using TUniQuery + TUniTransaction and there is some behaviour what I dont fully understand yet, probably I missed some information.

My problems:

1, When the user presses CTRL+DELETE in a TDBGrid or someone calls TUniQuery,Delete on a query, without SQLDelete filled at all, the record still will be deleted, which I really dont want. At this point I can still see the record in the database with other applicaton, for example PLSQL developer. Is there any property to disable this feature or I have to Abort the process in the BeforeDelete event?

2, In this case the TUniTransaction stays Active (in transaction) and when I close the application without any explicit closing of this transaction, it commits the transaction (and the record is permanently gone) even if I set TUniConnection.AutoCommit = False and left TUniTransaction.DefaultCloseAction = taRollback which is default.

I want to strictly prevent any kind of automatic DML and transaction handling.

Help me in this case, please.
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
UniDAC 7.4.12
Delphi 7

Here is the properties of components to reproduce the mentioned behaviours (replaced the sensitive data with stars):

Code: Select all

  object conMain: TUniConnection
    AutoCommit = False
    ProviderName = 'Oracle'
    Port = 1521
    SpecificOptions.Strings = (
      'Oracle.Direct=True')
    Options.AllowImplicitConnect = False
    Options.KeepDesignConnected = False
    Username = '*********'
    Server = '************-****.***.***.***.**:1521/******'
    LoginPrompt = False
  end
  object trMain: TUniTransaction
    DefaultConnection = conMain
  end
  object qryDemo: TUniQuery
    Connection = conMain
    Transaction = trMain
    SQL.Strings = (
      'select * from demo_table')
    DMLRefresh = True
  end

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Prevent TUniQuery delete without SQLDelete filled + TUniTransaction DefaultCloseAction behaviour

Post by MaximG » Sun 08 Nov 2020 20:19

Please create and send us a sample project with source code where the issue can be reproduced. Also we need the DDL script that creates the tables that you use in the sample project. For your convenience, please use the e-support form https://www.devart.com/company/contactform.html

tcxbalage
Posts: 23
Joined: Sat 04 Apr 2020 10:45

Re: Prevent TUniQuery delete without SQLDelete filled + TUniTransaction DefaultCloseAction behaviour

Post by tcxbalage » Mon 09 Nov 2020 01:08

requested codes has been sent by support form, thanks.

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Prevent TUniQuery delete without SQLDelete filled + TUniTransaction DefaultCloseAction behaviour

Post by MaximG » Sun 14 Feb 2021 19:17

Does the issue occur in the latest version of UniDAC (8.3.2)?

Post Reply