You're correct, the name repository file names were a typo. They should have been repositoryPostgreSQL.xml and repositoryPostgreSQL-user.xml respectively.
Also, I'm using OJB in client server mode. On the server, my repository is specified in OJB.properties as "repositoryFile=repository.xml". Do I also need to specify the repositoryPostgreSQL.xml somehow in the properties file? If this is not the problem, I will try and trace the createRepository() call and find out where it leads me... Thanks, Corey -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 26, 2002 2:48 PM To: OJB Users List Subject: Re: [Multiple Databases][Repository] Not Selecting the Correct Driver... Hi Corey, strange, everything seems ok. Only the repository file names ... > I am trying to use OJB with multiple databases and I have defined > repository.xml, > repositoryFarAway.xml, ## think you mean repositoryPostgreSQL.xml?! > and repositoryFarAway_user.xml. They ## think you mean repositoryPostgreSQL_user.xml?! > are appended at the end of this message. This is probably a simple > configuration error. If anyone can find the problem I would appreciate > it, > and send a documentation patch concerning "Multiple > Databases" (unless I > missed it). > > I am trying to store() an object in the "FarAway" database using the > following code: > > ProgressReport pr = new ProgressReport(); > // Create a new progress report > pr.setJob(" 117-02"); > pr.setEntryDate(new Date()); > pr.setRemarks("This is a test"); > pr.setSuperintendent("Super"); > PersistenceBroker broker = null; > try { > broker = > PersistenceBrokerFactory.createPersistenceBroker("repositoryPostgreSQL.x ml") > ; > broker.store(pr); > } catch (Throwable t) { > t.printStackTrace(); > } finally { > if (broker != null) { > broker.close(); > } > } > > Since I'm getting the following error, I know OJB is not using the correct > jdbc-connection-descriptor: > > ... > at > com.p6spy.engine.spy.P6PreparedStatement.setObject(P6PreparedStatement.j ava: > 280) > at > org.apache.ojb.broker.platforms.PlatformDefaultImpl.setObjectForStatemen t(Un > known Source) > at > org.apache.ojb.broker.platforms.PlatformMsAccessImpl.setObjectForStateme nt(U > nknown Source) > at > org.apache.ojb.broker.accesslayer.StatementManager.bindSelect(Unknown > Source) > at > org.apache.ojb.broker.accesslayer.JdbcAccess.materializeObject(Unknown > Source) > at > org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.store(Unknown Source) > at > org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.store(Unknown Source) > at org.apache.ojb.broker.server.RequestProcessor.execute(Unknown > Source) > at org.apache.ojb.broker.server.ConnectionHandler.run(Unknown > Source) > at java.lang.Thread.run(Thread.java:536) > > Thanks! > Corey > > *****repository.xml > > <?xml version="1.0" encoding="UTF-8"?> > <!-- This is a sample metadata repository for the ObJectBridge System. > Use this file as a template for building your own mappings--> > > <!-- defining entities for include-files --> > <!DOCTYPE descriptor-repository SYSTEM "repository.dtd" [ > <!ENTITY user SYSTEM "repository_user.xml"> > <!ENTITY junit SYSTEM "repository_junit.xml"> > <!ENTITY internal SYSTEM "repository_internal.xml"> > <!ENTITY postgresql SYSTEM "repositoryPostgreSQL_user.xml"> > ]> > > > <descriptor-repository version="0.9.5" isolation-level="read-uncommitted"> > <!-- The Default JDBC Connection. If a class-descriptor does not specify its > own JDBC Connection, > the Connection specified here will be used. --> > > <jdbc-connection-descriptor > platform="MsAccess" > jdbc-level="1.0" > driver="com.p6spy.engine.spy.P6SpyDriver" > protocol="jdbc" > subprotocol="odbc" > dbalias="Forefront Btrieve" > username="KCCCMK" > password="WEBSET" > > > </jdbc-connection-descriptor> > > <!-- include user defined mappings here --> > &user; > > <!-- include ojb internal mappings here --> > &internal; > > <!-- usar data for postgresql database --> > &postgresql > > </descriptor-repository> > > *****repositoryFarAway.xml you mean repositoryPostgreSQL.xml ? > <?xml version="1.0" encoding="UTF-8"?> > <!-- This is a sample metadata repository for the ObJectBridge System. > Use this file as a template for building your own mappings--> > > <!-- defining entities for include-files --> > <!DOCTYPE descriptor-repository SYSTEM "repository.dtd" [ > <!ENTITY postgresql SYSTEM "repositoryPostgreSQL_user.xml"> > ]> > > <descriptor-repository version="0.9.5" isolation-level="read-uncommitted"> > <!-- The Default JDBC Connection. If a class-descriptor does not specify its > own JDBC Connection, > the Connection specified here will be used. --> > > <jdbc-connection-descriptor > platform="PostgreSQL" > jdbc-level="1.0" > driver="org.sourceforge.jxdbcon.JXDBConDriver" > protocol="jdbc" > subprotocol="postgresql" > dbalias="//energy/kcci" > username="corey" > password="" > > > </jdbc-connection-descriptor> > > <!-- usar data for postgresql database --> > &postgresql; > > </descriptor-repository> > > *****repositoryFarAway_user.xml you mean repositoryPostgreSQL_user.xml ? > <!-- Please keep user defined mappings in this file only > to avoid mixing user defined and system mappings. --> > <!-- Mapping of User defined classes starts here --> > > <!-- KCCI Mappings --> > <class-descriptor > class="com.klaasmeyer.kcci.om.equipment.EquipmentReport" > table="equipment_report" > > > <field-descriptor id="1" > name="code" > column="code" > jdbc-type="VARCHAR" > primarykey="true" > /> > <field-descriptor id="2" > name="entryDate" > column="entry_date" > jdbc-type="DATE" > primarykey="true" > > conversion="com.klaasmeyer.forefront.om.ojb.ForefrontJavaDate2SqlDateFie ldCo > nversion" > /> > <field-descriptor id="3" > name="job" > column="job" > jdbc-type="VARCHAR" > /> > <field-descriptor id="4" > name="downtimeReason" > column="downtime_reason" > jdbc-type="VARCHAR" > /> > <field-descriptor id="5" > name="remarks" > column="remarks" > jdbc-type="VARCHAR" > /> > </class-descriptor> > <class-descriptor > class="com.klaasmeyer.kcci.om.progress.ProgressReport" > table="progress_report" > > > <field-descriptor id="1" > name="job" > column="job" > jdbc-type="VARCHAR" > primarykey="true" > /> > <field-descriptor id="2" > name="entryDate" > column="entry_date" > jdbc-type="DATE" > primarykey="true" > > conversion="com.klaasmeyer.forefront.om.ojb.ForefrontJavaDate2SqlDateFie ldCo > nversion" > /> > <field-descriptor id="3" > name="superintendent" > column="superintendent" > jdbc-type="VARCHAR" > /> > <field-descriptor id="4" > name="remarks" > column="remarks" > jdbc-type="VARCHAR" > /> > </class-descriptor> > > <!-- Mapping of User defined classes ends here --> > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
