LLBLGen 3.1, Postgres, How to set Read Only transaction?

Posts   
 
    
miloszes
User
Posts: 222
Joined: 03-Apr-2007
# Posted on: 08-Feb-2012 10:10:29   

Hi,

How can i Set postgresql Read Only transaction? Is it oneness with

adapter.StartTransaction(IsolationLevel.Snapshot, "FEnt");

?

http://www.postgresql.org/docs/9.1/static/sql-set-transaction.html

Best Regards, MiloszeS

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 08-Feb-2012 16:14:46   

Is this property exposed by Postgres .NET provider?

miloszes
User
Posts: 222
Joined: 03-Apr-2007
# Posted on: 09-Feb-2012 11:08:46   

I'm not sure rage .

I've found the possible pure sql usage.

begin transaction;

SET TRANSACTION READ ONLY;

SELECT ......

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 10-Feb-2012 10:34:23   

I can't find it anywhere on the net if this is exposed or not.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 10-Feb-2012 11:45:08   

The isolation mode is a .NET enum, and it doesn't have a 'ReadOnly' value. So npgsql is (IMHO) only able to work with the enum values in the .NET enum IsolationLevel. The postgresql docs aren't really helpful about what readonly really means. Couldn't you use one of the other alternatives, e.g. serializable or snapshot?

Frans Bouma | Lead developer LLBLGen Pro
miloszes
User
Posts: 222
Joined: 03-Apr-2007
# Posted on: 15-Feb-2012 13:22:38   

Indeed there is a lack of documentation in this area. I've find out in one postgresql in the good practice section, that we should use read only transactions where its possible. Unfortunately they didn't wrote how it impacts the db. Currently I switched into the snapshot transaction in my case, but wondering whether additional switch to read only transaction will impact performance a little bit. I'll try to ask npgsql developers about that and eventually reopen this ticket.