Set connection to read only and back to writable?

Set connection to read only and back to writable?

am 14.10.2005 17:15:36 von g111

Hello,

is it possible to switch a dbi-connection between read-only and writable?

Thank you,

Gert

Re: Set connection to read only and back to writable?

am 15.10.2005 16:07:43 von Tim.Bunce

On Fri, Oct 14, 2005 at 05:15:36PM +0200, Gert wrote:
> Hello,
>
> is it possible to switch a dbi-connection between read-only and writable?

It's not a standard part of the DBI API, but it is possible with some
drivers. Knowing which driver you're using might help us...

Tim.

Re: Set connection to read only and back to writable?

am 17.10.2005 18:11:53 von g111

Tim Bunce wrote:

> On Fri, Oct 14, 2005 at 05:15:36PM +0200, Gert wrote:

>> is it possible to switch a dbi-connection between read-only and writable?
>
> It's not a standard part of the DBI API, but it is possible with some

Hmm, ok. If it is not a standard feature I can only use it while developing
for debugging.

> drivers. Knowing which driver you're using might help us...

It is mysql and perhaps Oracle.

Thank you,

Gert

Re: Set connection to read only and back to writable?

am 18.10.2005 14:18:56 von Tim.Bunce

On Mon, Oct 17, 2005 at 06:11:53PM +0200, Gert wrote:
> Tim Bunce wrote:
>
> > On Fri, Oct 14, 2005 at 05:15:36PM +0200, Gert wrote:
>
> >> is it possible to switch a dbi-connection between read-only and writable?
> >
> > It's not a standard part of the DBI API, but it is possible with some
>
> Hmm, ok. If it is not a standard feature I can only use it while developing
> for debugging.

No, it just means that no database-independant API has been defined
so you'll need to use database-specific code.

> > drivers. Knowing which driver you're using might help us...
>
> It is mysql and perhaps Oracle.

Umm, now I come to look at it I see that mysql's "SET READ_ONLY=1"
command only works at the global level ("SET GLOBAL READ_ONLY=1")
and that's probably not what you want. I've no time to dig further.

Anyone know how a connection can be set to read-only in MySQL and/or Oracle?

Tim.

Re[2]: Set connection to read only and back to writable?

am 18.10.2005 16:59:12 von wieland

Hallo Tim,

Tuesday, October 18, 2005, 2:18:56 PM, you wrote:
....
TB> No, it just means that no database-independant API has been defined
TB> so you'll need to use database-specific code.

>> > drivers. Knowing which driver you're using might help us...
>>=20
>> It is mysql and perhaps Oracle.

TB> Umm, now I come to look at it I see that mysql's "SET READ_ONLY=3D1"
TB> command only works at the global level ("SET GLOBAL READ_ONLY=3D1")
TB> and that's probably not what you want. I've no time to dig further.

TB> Anyone know how a connection can be set to read-only in MySQL and/or Or=
acle?

For Oracle:
set transaction read only;

cu
Wieland mailto:wieland@wielandpusch.de

Re[3]: Set connection to read only and back to writable?

am 24.10.2005 20:27:46 von wieland

Hello,

when rereading my own mail, I must correct. This sets only the current
transaction into read only and not the connection.
And it fails if the current transaction was already writing.

Tuesday, October 18, 2005, 4:59:12 PM, I wrote:
WP> Tuesday, October 18, 2005, 2:18:56 PM, you wrote:
TB>> Anyone know how a connection can be set to read-only in MySQL and/or O=
racle?
WP> For Oracle:
WP> set transaction read only;

cu
Wieland mailto:wieland@wielandpusch.de