tabs ↹ over ␣ ␣ ␣ spaces

by Jiří {x2} Činčura

Disabling database triggers in FirebirdClient

22 May 2012 2 mins .NET, Firebird

Database triggers are a nice new feature added to Firebird in version 2.1. And as you can do a lot of stuff with them, sometimes you also might wanna to connect without firing these, especially if you made a mistake there and it’s forcibly closing your connection. 😃 To disable these, standard Firebird utilities have a new switches. But it boils down to the API itself, nothing magical.

And if it’s in API, it could be FirebirdClient, right? In last few days among working on other bugs and my daily responsibilities I had a time to dig into this. And now also from .NET world we can use this feature.

It’s on two places. First is standard FbConnection level. New connection string property no db triggers (and some aliases) was added (and similarly named property in FbConnectionStringBuilder). If you set it to True, database triggers will be disabled for this connection. If you think about pooling and this feature carefully you might come to conclusion it’s unclear how it should behave. Same for me. After a quick discussion in mailing list, it’s now invalid to use pooling and disabling database triggers in same connection string. You’ll get error when trying to use it.

The other part is for backups via FbBackup class. Here it’s based on long lived FbBackupFlags, NoDatabaseTriggers to be precise. Simply add it to your options and you’re done. Connection string’s option is ignored here.

I know nothing mind blowing, but I’m always happy to have new feature there and provide more power for developers.

Profile Picture Jiří Činčura is .NET, C# and Firebird expert. He focuses on data and business layers, language constructs, parallelism, databases and performance. For almost two decades he contributes to open-source, i.e. FirebirdClient. He works as a senior software engineer for Microsoft. Frequent speaker and blogger at www.tabsoverspaces.com.