Start read only transactions not work

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
delphiman
Posts: 9
Joined: Mon 27 Jul 2020 18:11

Start read only transactions not work

Post by delphiman » Thu 13 Jan 2022 12:48

Hello, I'm performing some tests where I need to perform a query in the database in read-only mode, that is, I want to start a read-only transaction, consult the data and close this transaction.

I did several tests configuring transaction isolation, but I may be doing something wrong as it is not querying with the isolation I request.

Can you give me a correct example of how to use it?

Sample:

Code: Select all

IBCConnection1.DefaultTransaction.IsolationLevel := iblReadOnlyReadCommitted;
IBCConnection1.Open;
IBCConnection1.StartTransaction;
IBCQuery1.Close;
IBCQuery1.SQL.Text := 'select * from test';
IBCQuery1.Open;
IBCConnection1.Commit;

Thanks.

Best Regarts;

pavelpd
Devart Team
Posts: 109
Joined: Thu 06 Jan 2022 14:16

Re: Start read only transactions not work

Post by pavelpd » Fri 14 Jan 2022 15:49

Hi there!

Thank you for your question!

We checked the work of the code fragment you have sent and found no issues.
Your code does not contain any data modification operations, so it runs without any errors or warnings. In case of execution of any request to change the data, you will receive a message "attempted update during read-only transaction".
Please, explain what is incorrect in such behavior from your point of view?

Post Reply