| От | Björn Lundin |
|---|---|
| Тема | Re: determining if there's a transaction in progress |
| Дата | |
| Msg-id | ajqbnu$25ma$1@news.hub.org обсуждение исходный текст |
| Ответ на | Re: determining if there's a transaction in progress ("Warren W. Gay VE3WWG" <ve3wwg@cogeco.ca>) |
| Список | pgsql-interfaces |
Warren W. Gay VE3WWG wrote: <cut> > I too could benefit from a libpq feature that indicates if a transaction > is pending. This > helps in determining in a destructor (or Ada finalization) whether the > default action > to rollback/commit is necessary (rather than depend upon the server > default action). > Assuming it is always necessary is clumsy, and imposes unnecessary > overhead in > situations where a transaction may not be in progress. </cut> In Ada, you could keep track of transaction state in a package. Put 'start_trans', 'commit' and 'rollback' procedures that changes the transaction state accordingly. You'll then need a function 'trans_in_progress' to check it Example at http://home.swipnet.se/lundin/ada_95_tools.html /Bj�rn
В списке pgsql-interfaces по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера