db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mamta Satoor" <msat...@gmail.com>
Subject Re: PreparedStatement.setXXX methods do not set up ContextStack. Is that right and if so, why?
Date Tue, 06 Mar 2007 15:52:27 GMT
I have spent some time exploring the code to see how the Locale info can be
passed to a datatype's locale sensitive methods. What I am finding is that
these locale sensitive methods, for instance setValue method in datatype
like SQLTime, get called from many different places in the Derby code. Now,
I might be single tracking my thoughts here, but it seems to me that context
stack might be the right way for these different callers to get handle of
locale info and pass it to the setValue methods. Maybe there are some other
solutions too which I am not able to visulaize at this point.

I will keep looking more for other ways of getting handle of locale info to
pass on to locale sensitive methods but am I missing some other easier
possible solution to pass the locale info to locale sensitivie methods of


On 3/5/07, Daniel John Debrunner <djd@apache.org> wrote:
> Mamta Satoor wrote:
> > Another solution that I have been thinking of is to have the locale
> > dependents datatypes by aware of their locale so they can use that
> > locale information in their locale sensitive methods. So, for eg, in the
> > ij script example that we are discussing, SQLTimestamp in it's
> > constructor should get the Locale/LocaleFinder/some other effective
> > object (copying Dan's line literally here) and locale sensitive methods
> > like setValue can simply find the locale info in it's class itself.
> >
> > So, in other words, rather than passing the locale info to the locale
> > sensitive methods, pass it to the locale sensitive datatype in it's
> > constructor and use that locale info in all the locale sensitive methods
> > in that datatype class.
> I think there are a couple of issues with this approach:
> - the size in memory of each instance of a value (e.g. SQLTimestamp)
> will increase. Passing in the value will only increase a single object
> (e.g. the activation or language connection context). Imagine a query
> that performs a lot of manipulation of timestamp values.
> - How to handling reading the value from disk? Would information about
> the locale need to be stored on disk to allow the object to be recreated
> correctly? Thus increasing on-disk size? (and upgrade issues?).
> Dan.
> Dan.

View raw message