tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abraham Fdez" <>
Subject RE: Read-Only Context with Tomcat + Hibernate
Date Thu, 16 Feb 2006 07:36:21 GMT
Yeah Kenevel,

I know this (This is what I am doing) but I want to give a name to
Hibernate's SessionFactory like "<session-factory
name="java:comp/Hibernate/blahblahblah" and in that case is where Tomcat
says me that Context is read-only. I want this because I'm doing a Tomcat
Cluster with some servers and each one must have a SessionFactory with same
name in order to use Tomcat Persistent sessions manager on a postgresql

Do you know anything about naming SessionFactory object in Tomcat?

Thanks a lot,

Abraham Fernández Álvarez

Dpto. de Informática 
Parque Empresarial La Finca
Pº de la Finca, bloque 11 2ª Planta
28223 Pozuelo de Alarcón (Madrid) 
( +34 91 7689211
7 +34 91 7689225 

-----Mensaje original-----
De: Kenevel [] 
Enviado el: miércoles, 15 de febrero de 2006 14:46
Para: Tomcat Users List
Asunto: Re: Read-Only Context with Tomcat + Hibernate

Abraham Fdez wrote:
> I'm making a Web application with Apache + Tomcat + Mod_Jk +
> Hibernate + Postgresql. I need that hibernate binds factory to JNDI
> but when I do that it gives me and error that context is read-only.

>>From memory Tomcat has a JNDI context that is read-only, but which can
accept values bound to it in the configuration files. So you can set up a
data-source in the conf/Catalina/localhost/yourcontext.xml file and bind
this to a JNDI name. This is then available to be read (only).

There will be docs on this but it looks something like this:

<Context path="/yourpath" docbase="/var/www/webapp/" ... >
    <Resource name="jdbc/datasourceJndiName" auth="Container" ... />

Incidentally, Spring is a superb way of integrating a Java webapp and


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message