incubator-empire-db-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andrew cooke <>
Subject Re: Retrieving auto-generated keys after insert
Date Tue, 06 Oct 2009 12:42:35 GMT
2009/10/5 Rainer Döbele <>:
>> I am a bit surprised about the case problem as I did not expect HSQL to be case sensitive
at this point.
> I must admit that I am more familiar with Oracle and SQL Server. But I agree that the
driver should deal with this problem to make the client code as portable as possible. The
casing of a database object should not matter.
> The quoting of the names usually depends on key-words but can be overridden in detectQuoteName(String
name) from the driver.
> If you find a good way to do it and you want to share your findings with us we will publish
it with the next release.

I have not tried this, but the simplest way to avoid the problem would
be to always quote names.  So if this problem is limited to HSQL then
you could simply change detectQuoteName to always return true (but see
my comments below)

Otherwise, it appears that in this case the value must be quoted in
one place because it is used to retrieve a value from a system table,
so the table name is being treated as a literal string.  In that case,
a specific fix would be to force the string to upper case if it is
*not* quoted normally (ie if detectQuoteName is false).

More generally, this is the first time I have worked with HSQL, but I
have had similar problems in the past with other databases.  I suspect
that your library works not because other databases don't also assume
unquoted names are upper case, but because you are always consistent
in quoting or not quoting.  That breaks in this particular case for
the reason noted above (that the table name is treated as a literal
string).  And since the code in question is related to sequence
generation, and other databases don't use that approach by default (if
I understood your previous email correctly) this problem may occur for
other databases, but simply isn't noticed because they handle
autoincrement in a different way.


View raw message