Hi all,

Experiencing some odd behaviour with OJB 9.7/ODMG in a tomcat 4.0
environment. Roughly, a connection is made (to postgres) with a
specified user/password, to try and create an object. However when the
sequence manager tries to generate a valid sequence, OJB tries to
support this using what it says is the default user. This is OK as it is
an internal OJB operation (we are getting the sequences generated from
the DB) as we don't care about the user info for this. However the
"default user" details seem to now have a username of null - all of the
other default data is correct as specified in repository.xml!

We have double checked the repository files and everything is OK on that
score - it just seems that soemwhere along the line the default jdbc
connection descriptor is being modified for the username field only, for
some reason. The other odd thing is that this only happens in a web
(tomcat) environment - doing exactly the same thing in an application
works OK! We also make sure to join the TX with each new thread in a
session.

The stack trace is as follows (throws error that cannot create with a
null user - also get the general runtimeException about being unable to
autoincrement the PK field, which appears to be thrown for many
different reasons from what I have read so that may be a red
herring...):

at org.postgresql.Connection.openConnection(Connection.java:274)
        at org.postgresql.Driver.connect(Driver.java:149)
        at java.sql.DriverManager.getConnection(DriverManager.java:512)
        at java.sql.DriverManager.getConnection(DriverManager.java:171)
        at
org.apache.ojb.broker.accesslayer.AbstractConnectionFactory.getConnectionFromDriverManager(Unknown

Source)
        at
org.apache.ojb.broker.accesslayer.AbstractConnectionFactory.getConnection(Unknown

Source)
        at
org.apache.ojb.broker.accesslayer.ConnectionFactoryConPooledImpl$ConPoolFactory.makeObject(Unknown

Source)
        at
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(Unknown
Source)
        at
org.apache.ojb.broker.accesslayer.AbstractPoolableConnectionFactory.lookupConnection(Unknown

Source)
        at
org.apache.ojb.broker.accesslayer.ConnectionManager.getConnection(Unknown

Source)
        at
org.apache.ojb.broker.accesslayer.StatementsForClassImpl.prepareStatement(Unknown

Source)
        at
org.apache.ojb.broker.accesslayer.StatementsForClassImpl.getPreparedStmt(Unknown

Source)
        at
org.apache.ojb.broker.accesslayer.StatementManager.getPreparedStatement(Unknown

Source)
        at
uk.ac.ebi.intact.persistence.PostgresSequenceManager.prepareSequenceStm(PostgresSequenceManager.java:139)

        at
uk.ac.ebi.intact.persistence.PostgresSequenceManager.getUniqueId(PostgresSequenceManager.java:154)

        at
uk.ac.ebi.intact.persistence.PostgresSequenceManager.getUniqueString(PostgresSequenceManager.java:185)

        at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getUniqueString(Unknown

Source)
        at
org.apache.ojb.broker.metadata.ClassDescriptor.getAutoIncrementValue(Unknown

Source)
        at
org.apache.ojb.broker.metadata.ClassDescriptor.getKeyValues(Unknown
Source)
        at org.apache.ojb.broker.Identity.<init>(Unknown Source)
        at
org.apache.ojb.odmg.locking.LockManagerDefaultImpl.writeLock(Unknown
Source)
        at org.apache.ojb.odmg.TransactionImpl.lock(Unknown Source)
        at
uk.ac.ebi.intact.persistence.ObjectBridgeDAO.create(ObjectBridgeDAO.java:373)

        at
uk.ac.ebi.intact.business.IntactHelper.create(IntactHelper.java:412)
        at
uk.ac.ebi.intact.application.cvedit.business.IntactUserImpl.create(IntactUserImpl.java:194)

        at
uk.ac.ebi.intact.application.cvedit.struts.controller.CommentAddAction.perform(CommentAddAction.java:93)

        at
org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1787)

        at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1586)
        at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)

Anyone come across thi type of thing before? Surely someone must have
tried to create objects in a DB, via a web server and ODMG, using
various different usernames?

Any help appreciated!!

Cheers,

Chris


--
To unsubscribe, e-mail:   <mailto:ojb-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:ojb-user-help@;jakarta.apache.org>

Reply via email to