Subject Re: Transactions closing
Author richwiz11
Another question relating to the use of TIB_StoredProc and TIB_Query,

is it more efficient to use TIB_Query over TIB_StoredProc where possible. For example i have SP to get customer, it doing a bit more than just a select statement hence it SP, At the moment we often using TIB_StoreProc to get this data, but is it better for me to switch it to TIB_Query. Does this reduce overhead in doing so. That SP is really only a read only data, i not updating or changing any data.

--- In IBObjects@yahoogroups.com, Thomas Steinmaurer <ts@...> wrote:
>
> > I have just moved across to firebird 2.5 and have noticed some transactions are being left active for a lengthy period. I am manually controlling the transactions. AutoCommit is false, i am also using tiCommitted.
>
> Either use IBO's tracing capabilities or use the Firebird 2.5 Trace API
> to see exactly what's going on.
> See my article on the Trace API here:
> http://www.ibphoenix.com/resources/documents/general/doc_3
>
> > I have found that if i am not commiting or rollbacking a transaction an query/dataset (TIB_Query) is automatically closed after a period of time.
>
>
> IBO is doing that behind the scene to enable moving OIT/OAT forward.
>
>
> However for store procedure (TIB_StoreProcedure) this transactions is
> being left open.
> > So my question is should i always be making sure i either commit or rollback whenever i use storeprocedure and have finished with it as such. (in the case of edit or insert data i always save it) but when i am reading data, rather than use a query i am sure SP and not always saving it after i got my data. Is this going to cause problems and is it bad practice?
>
> In general, when you are done with something in context of an explicit
> transaction, issue a commit/rollback to end the transaction.
>
> Make also use of read-only transactions, if you don't need to write
> something. With long-running read committed, read-only transactions,
> OIT/OAT won't get stuck.
>
>
>
> --
> With regards,
> Thomas Steinmaurer
>
> * Firebird Foundation Committee Member
> http://www.firebirdsql.org/en/firebird-foundation/
>
> * Upscene Productions - Database Tools for Developers
> http://www.upscene.com/
>
> * My Blog
> http://blog.upscene.com/thomas/index.php
>