Page 1 of 1

opened Connection with Firebird 2.5

Posted: 19.05.2014, 18:05
by lucAlucard
I'm using ZeosLib 7.1.2-stable with Firebird version 2.5. The following code show active transactions in firebird and the SQL code that left the connection opened.

Code: Select all

select
    b.mon$user,
    c.mon$sql_text,
    a.mon$transaction_id,
    a.mon$attachment_id,
    a.mon$state,
    a.mon$timestamp,
    a.mon$top_transaction,
    a.mon$oldest_transaction,
    a.mon$oldest_active,
    a.mon$isolation_mode,
    a.mon$lock_timeout,
    a.mon$read_only,
    a.mon$auto_commit,
    a.mon$auto_undo,
    a.mon$stat_id,
    case a.mon$isolation_mode
       when 0 then 'Consistency'
       when 1 then 'Concurrency'
       when 2 then 'Read Committed Record Version'
       when 3 then 'Read Committed'
       else 'Unknown'
    end as Desc_Isolation,
    case a.MON$LOCK_TIMEOUT
       when -1 then 'Infinite Wait'
       when  0 then 'No wait'
       else 'Timeout ' || cast(MON$LOCK_TIMEOUT as varchar (20))
    end as Desc_TimeOut
from mon$transactions a
join MON$ATTACHMENTS b on b.MON$ATTACHMENT_ID = a.MON$ATTACHMENT_ID
join MON$STATEMENTS c on c.MON$ATTACHMENT_ID = a.MON$ATTACHMENT_ID
where (a.mon$attachment_id <> current_connection)
order by 1

And i sow that SQL that left the oppened transaction:

Code: Select all

SELECT a.RDB$RELATION_NAME, a.RDB$FIELD_NAME, a.RDB$FIELD_POSITION, a.RDB$NULL_FLAG, a.RDB$DEFAULT_VALUE, b. RDB$FIELD_LENGTH, b.RDB$FIELD_SCALE, c.RDB$_NAME, b.RDB$FIELD_, b.RDB$FIELD_SUB_, b.RDB$DESCRIPTION, b.RDB$CHARACTER_LENGTH, b.RDB$FIELD_PRECISION, a.RDB$DEFAULT_SOURCE, b.RDB$DEFAULT_SOURCE as RDB$DEFAULT_SOURCE_DOMAIN,b.RDB$COMPUTED_SOURCE as RDB$COMPUTED_SOURCE , b.RDB$CHARACTER_SET_ID FROM RDB$RELATION_FIELDS a JOIN RDB$FIELDS b ON (b.RDB$FIELD_NAME = a.RDB$FIELD_SOURCE) LEFT JOIN RDB$ c ON (b.RDB$FIELD_ = c.RDB$ and c.RDB$FIELD_NAME = 'RDB$FIELD_) WHERE 1=1 and trim(a.RDB$RELATION_NAME) = 'TABLE_NAME' ORDER BY a.RDB$RELATION_NAME, a.RDB$FIELD_POSITION
When I was searching this SQL, I found it in the following document: "ZDbcInterbase6Metadata.pas" in the function: "TZInterbase6DatabaseMetadata.UncachedGetTables.". Is it a bug or Am I not using correctly the component and It doesn't close the connections?