You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Florin Manolache <fl...@ecstend.com> on 2005/07/08 14:26:53 UTC

How to set the connection read-only?

Is there a way to set the connection in the read-only state before starting a transaction?
I'm using a mix of DAOs and sqlMaps in my application so I'm interested in a solution for both of them.

Thanks,
Florin

How to connect to database using JNDI

Posted by am...@tcs.com.
Hi all,
I'm trying to use ibatis along with Oracle 9i for a web application. I've 
created connection pool named 'cpPMR' and data source 'dataSourcePMR' with 
jndi name 'jndiPMR'. 
Can some body tell me how can i connect to database using jndi name in a 
servlet. what will be my 'sql-map-config.xml'. code snippet will be really 
helpful.

Thanks in advance.

Amit Rogye


Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information.   If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited.   If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments.  Thank you

Re: How to set the connection read-only?

Posted by Florin Manolache <fl...@ecstend.com>.
In my read-only transactions, I read data from multiple tables, and I want to get a consistent view (I don't want other transactions which are not read-only to modify data between 2 reads from 2 different tables). Setting the transaction read-only is supposed to give hints to the database/driver that I am not modifying anything, so it can perform transactions optimizations. 

Basically what I need to do is to get a reference to the current connection being used by DAOs and sqlMap and call setReadOnly(true) on it. 

Thanks,
Florin


  ----- Original Message ----- 
  From: Clinton Begin 
  To: user-java@ibatis.apache.org ; Florin Manolache 
  Sent: Saturday, July 09, 2005 11:59 PM
  Subject: Re: How to set the connection read-only?



  Florin,

  I don't understand why you would do that.  If you have a connection that's read-only, why would you need a transaction at all? (or vice versa)

  Cheers,
  Clinton



  On 7/8/05, Florin Manolache <fl...@ecstend.com> wrote:

    Is there a way to set the connection in the read-only state before starting a transaction?
    I'm using a mix of DAOs and sqlMaps in my application so I'm interested in a solution for both of them.

    Thanks,
    Florin



Re: How to set the connection read-only?

Posted by Clinton Begin <cl...@gmail.com>.
Florin,

I don't understand why you would do that. If you have a connection that's 
read-only, why would you need a transaction at all? (or vice versa)

Cheers,
Clinton


On 7/8/05, Florin Manolache <fl...@ecstend.com> wrote:
> 
>  Is there a way to set the connection in the read-only state before 
> starting a transaction?
> I'm using a mix of DAOs and sqlMaps in my application so I'm interested in 
> a solution for both of them.
>  Thanks,
> Florin
>