Subject Re: [Firebird-Java] UTF-8 and tomcat
Author Ray Holme
On Sat, 2014-04-05 at 11:01 +0200, Mark Rotteveel wrote:
> On 5-4-2014 00:03, Ray Holme wrote:
> > I have used firebird for multiple tomcat web applications.
> > We use the tomcat connection pool successfully for multiple
> > applications.
> What do you use to populate the connection pool (eg which Firebird
> classes, config of the connection pool)?
I think that is covered below in the application.xml file excerpt
for the Resource. Otherwise I am not sure what you are asking?
> > Recently we had to resurrect two applications and use UTF-8.
> > We think all the right things were done:
> > post requests use tomcat built-in filter
> > application.xml file says UTF-8
> > jsp files all marked for UTF-8
> >
> > The applications come up and we can do things with them, but the
> > connections seem to start failing within a minute or so.
> >
> > I am not sure that we have not done something else wrong, but the
> only
> > commonality between the two applications failing is UTF-8.
> >
> > Has anyone seen anything like this?
> Could you provide some more detail:
> * How do connections fail (exceptions, etc)?
> * Which Jaybird version?
> * Which Firebird version?
> * What is the connection character set?
> * What is the default database character set?

It appears we have problems getting connections from the pool sometimes.
I am working on getting more information about that (log files). No
special exceptions occur. The problems start to occur after running a
couple of minutes. In case, I did not say this - this application was
fully running before we converted DB and application to UTF-8 for French
(et al) characters.

LI-V2.5.2.26539 Firebird 2.5

Resource name="jdbc/ischoolsDS" auth="Container"
maxActive="100" minIdle="10" maxWait="10000" initialSize="10"
testWhileIdle="true" testOnBorrow="true" testOnReturn="false"
validationQuery="select 1 from rdb$database"
removeAbandonedTimeout="60" removeAbandoned="true"
username="SECRET" password="MORESECRET"

url="jdbc:firebirdsql:localhost:/local/db/someName.db?encoding=UTF8" /

DB Default Character set: UTF8


All JSP files start with:

<%@page contentType="text/html; charset=UTF-8" language="java"%>

No changes made to Java files for UTF-8
- some of these are directly in the web.xml file as servlets, not just
usage beans
web.xml also has it's first line as
<?xml version="1.0" encoding="UTF-8"?>

--- I hope I answered your questions, and hope you see something we
forgot to do.