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 ...;

I am not that familiar with how it is used but it generally gets used for BI
type applications, and for workload management. So that the database can for
instance prioritize queries for a particular application. The client funding
the td datastore ask that the query banding feature be utilized.

Anyways, that said the problem is basically that I need to be able to set
certain query bands before statements executed by the jdbc datastore.
And currently don't have a great mechanism to do so since it is really out
of the dialect hands.

The best solution I can come up with is to add some callback methods to the
dialect that the datastore will call before it executes a statement. For
example:

BasicSQLDialect {

  onSelect(Statement st, Connection cx, FeatureType);

  onDelete(Statement st, Connection cx, FeatureType);

  onInsert(Statement st, Connection cx, FeatureType);

  onUpdate(Statement st, Connection cx, FeatureType);

}

PreparedSQLDialect {

  onSelect(PreparedStatement st, Connection cx, FeatureType);

  onDelete(PreparedStatement st, Connection cx, FeatureType);

  onInsert(PreparedStatement st, Connection cx, FeatureType);

  onUpdate(PreparedStatement st, Connection cx, FeatureType);

}

And then in the callback i would execute the necessary query band.

THe other approach I thought about was maybe trying to wrap/proxy the
connection or statement and execute query bands there... but it got pretty
messy pretty fast as you can imagine. And I figure this approach could
potentially be useful for other purposes as well.

Thoughts?

-- 
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