Start read only transactions not work

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for InterBase & Firebird in Delphi and C++Builder
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 11:32

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: 42
Joined: Thu 06 Jan 2022 14:16

Re: Start read only transactions not work

Post by pavelpd » Wed 19 Jan 2022 17:07

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?

delphiman
Posts: 9
Joined: Mon 27 Jul 2020 18:11

Re: Start read only transactions not work

Post by delphiman » Wed 19 Jan 2022 19:48

Hi, sorry for the delay. The forum notification went to the spam box in my email.

I really got confused, a thousand apologies.

The transaction is starting correctly. I was analyzing Firebird system tables and mistake the informations.

It's all correct.

Thank you very much for the feedback and sorry for my fail.

Best Regarts.

Post Reply