There are two types of query banding. The first is session/connection based.
The second is statement/transaction based.

For session wide query bands indeed the initializeConnection will work.
Since such query bands are considered global it is ok to share them among
connections in the pool.

For statement/transaction query bands one uses the statement:

SET QUERY_BAND = 'foo = bar` for TRANSACTION;

I had the same concern as you but I am told by the client that this query
band then only lives for the next statement and then goes away. So by the
time the connection is thrown back into the pool the query band settings are
gone.


On Thu, Apr 28, 2011 at 10:52 AM, Andrea Aime
<[email protected]>wrote:

> On Thu, Apr 28, 2011 at 6:44 PM, Andrea Aime
> <[email protected]> wrote:
> > On Thu, Apr 28, 2011 at 6:35 PM, Justin Deoliveira <[email protected]>
> wrote:
> >> Hi all,
> >> I wanted to get some feedback on a problem i am trying to solve and a
> >> possible solution. First the problem.
> >> It comes out of working on the teradata datastore. The td database has a
> >> feature called "query banding". It is very simple in nature. It is
> basically
> >> just a statement that sets some key value pairs before another statement
> is
> >> executed, or set some key value pairs for the life of a connection. A
> common
> >> example is to set the name of the application. So one might do:
> >> SET QUERY_BAND = 'Application = geotools`;
> >> SELECT * FROM ...;
>
> And oh, another thing. That SET will conceivably set the param
> for the connection's entire life.
> Connections are pooled so... how do you plan to remove those settings
> once you're done using them?
> If you are using query banding on some data access and none in others,
> the others will inherit that set you executed before
>
> Cheers
> Andrea
>
> --
> -------------------------------------------------------
> Ing. Andrea Aime
> GeoSolutions S.A.S.
> Tech lead
>
> Via Poggio alle Viti 1187
> 55054  Massarosa (LU)
> Italy
>
> phone: +39 0584 962313
> fax:      +39 0584 962313
>
> http://www.geo-solutions.it
> http://geo-solutions.blogspot.com/
> http://www.youtube.com/user/GeoSolutionsIT
> http://www.linkedin.com/in/andreaaime
> http://twitter.com/geowolf
>
> -------------------------------------------------------
>



-- 
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to