Subject Re: [firebird-support] Problem with multiple isql sessions
Author Gerhard Wiesinger
On Sun, 22 Apr 2007, Helen Borrie wrote:

> At 05:01 PM 22/04/2007, you wrote:
>> Hello!
>>
>> I'm new to firebird but have experience with other databases (MySQL,
>> PostgreSQL, Oracle, ...).
>>
>> Setup worked well but I'm having the following problems:
>> 1.) Other session not updated:
>> Session 1 with isql:
>> INSERT & COMMIT
>>
>> Session 2 with isql after commit of session 1 (isql already open):
>> SELECT COUNT(*) from tablename; -- Still 0, works only after quitting isql
>> and restart it.
>
> All you actually need to do is COMMIT the transaction in Session 2
> first! isql's transaction is by default in snapshot (concurrency)
> isolation so your existing isql session won't see what other
> transactions have done until after the commit. (isql will then open
> a new transaction: no need to quit to achieve this!!)
>
> ./heLen
>

Ok, I'm doing a
SET TRANSACTION WAIT ISOLATION LEVEL READ COMMITTED;
in both sessions.

But now when I'm doing:
Session 1:
SET TRANSACTION WAIT ISOLATION LEVEL READ COMMITTED;
insert into ....
-- sleep here, goto Session 2
commit;

Session 2:
select count(*) from ...
-- it hangs here until the commit

PostgreSQL handles this situation without a lock of session 2 in the same
isolation level.

Firebird should handle this also very well because it has MVCC, right?

Thank you for the answer.

Ciao,
Gerhard

--
http://www.wiesinger.com/