J�lio Cesar de Melhado e Lima wrote:
I'm using Tomcat 5.0.28, Postgres 7.4 and OJB 1.0.1.

So, I made available a JNDI Resource "mydatasource", and this resource is accessable ( I wrote a tiny jsp page to lookup for this object and everything looks fine ).

Then a change the file "repository_database.xml" ( where I keep my database configuration ) to :

<jdbc-connection-descriptor
jcd-alias="default"
default-connection="true"
platform="PostgreSQL"
jdbc-level="3.0"
jndi-datasource-name="mydatasource"
batch-mode="false"
useAutoCommit="2"
ignoreAutoCommitExceptions="false">

You need to specifying the name of the initial JNDI context like so:
 jndi-datasource-name="java:/comp/env/jdbc/mydatasource"

See also Tomcat's JNDI DataSource HOWTO [1] (although the coding
examples will look up the DataSource in the "java:/comp/env" context,
as opposed to OJB's direct lookup in the InitialContext).

If you are later planning on using a managed environment and external
transaction control, set:
 useAutoCommit="0"
and change OJB.properties setting of ConnectionFactoryClass to:
  
ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryManagedImpl

Regards,
 Martin

[1] 
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to