Wow, that helped a lot :-) I didn't have any dsfactory stuff in my config at
all; re-using the same Torque.properties I used when generating at runtime,
with the changes you suggested, moved things along. But now I'm getting
this:

...
1186 [Thread-0] DEBUG oid.IDBroker  - IDBroker thread was started.
Exception in thread "main" org.apache.torque.TorqueException: IdGenerator
for table 'SsUser' is null
        at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:690)
        at net.holoweb.ss.db.BaseSsUserPeer.doInsert(Unknown Source)
        at net.holoweb.ss.db.BaseSsUserPeer.doInsert(Unknown Source)
        at net.holoweb.ss.db.BaseSsUser.save(Unknown Source)
        at net.holoweb.ss.db.BaseSsUser.save(Unknown Source)
        at net.holoweb.ss.db.BaseSsUser.save(Unknown Source)
        at net.holoweb.ss.dbtools.Try.main(Unknown Source)

That's with an explicit 'idMethod="native"' on every table definition; the
global default seems not to work. I'm going to delve in and see if I can
figure out what's wrong, but if anyone can give me a quick answer I'll be a
happy laddie! :-)

Cheers,

L.

On 10/6/02 1:54 PM, "Patryk Laurent" <[EMAIL PROTECTED]> wrote:

> Laurie,
> 
> I encountered both of the problems you mention.  First, to correct the
> actual error about the DSfactory, I duplicated the contents of the
> Torque.properties file so that all lines beginning with:
> torque.dsfactory.default
> were switched to
> torque.dsfactory.myDataBaseProject
> 
> I also set my 
> torque.database.default=myDataBaseProject
> 
> Hopefully this will help.
> 
> As for getting rid of the the warning about transactions, I believe I
> solved it by removing any "default" settings for the auto-incremented
> fields and set the <table> element in the XML schema to have something
> like <table name=xyz idBroker=native>.
> 
> The other thing I noticed was that the XML schema generated from the
> JDBC-to-XML script was a little odd and in my case required some
> correcting.
> 
> Good luck.
> Patryk
> 
> On Sun, 2002-10-06 at 21:42, Laurie Harper wrote:
>> I'm having a bit of trouble getting the code generated by Torque to actually
>> run... The only documentation I found on this was in the Tutorial and I've
>> followed that, but I keep getting exceptions. I'm using Torque 3.0b4, BTW.
>> 
>> The first problem is that Torque fails to load the database driver, with the
>> message 
>> 
>>   [main] ERROR org.apache.torque.adapter.DBFactory -
>>     java.lang.ClassNotFoundException: org.apache.torque.adapter.null
>> 
>> Which is followed by a StringIndexOutOfBoundsException. I managed to fix
>> that by changing the following configuration
>> 
>>   services.DatabaseService.database.adapter=DBPostgres
>>   services.DatabaseService.database.adapter.DBPostgres=org.postgresql.Driver
>> 
>> To
>> 
>>   services.DatabaseService.database.foo.adapter=DBPostgres
>>   services.DatabaseService.database.foo.adapter.DBPostgres=
>>     org.postgresql.Driver
>> 
>> But now it's followed by a 'InstantiationException: Unknown JDBC driver:
>> DBPostgres: Check your configuration file' so I changed the configuration to
>> 
>>   services.DatabaseService.database.adapter=org.postgresql.Driver
>> 
>> That gives me the following output
>> 
>> 2002-10-06 20:10:32,195 [main] INFO  org.apache.torque.Torque - Logging has
>> been configured by Torque.
>> 2002-10-06 20:10:33,097 [main] WARN  org.apache.torque.oid.IDBroker -
>> IDBroker is being used with db 'ss', which does not support transactions.
>> IDBroker attempts to use transactions to limit the possibility of duplicate
>> key generation.  Without transactions, duplicate key generation is possible
>> if multiple JVMs are used or other means are used to write to the database.
>> Exception in thread "main" java.lang.NullPointerException: There was no
>> DataSourceFactory configured for the connection ss
>>         at org.apache.torque.Torque.getConnection(Torque.java:924)
>>         at 
>> org.apache.torque.util.Transaction.beginOptional(Transaction.java:113)
>>         at org.apache.torque.util.Transaction.begin(Transaction.java:97)
>>         at net.holoweb.ss.db.BaseSsUser.save(Unknown Source)
>>         at net.holoweb.ss.db.BaseSsUser.save(Unknown Source)
>>         at net.holoweb.ss.dbtools.Try.main(Unknown Source)
>> 
>> I suspect I'm being tripped up by changes that have occurred in Torque since
>> the tutorial was written :-( I tried downgrading to Torque 2.1 but couldn't
>> figure out how to initialise that version.
>> 
>> What version of Torque should I be using so that the documentation will be
>> consistent with what I need to do? Or alternatively can someone just tell me
>> what I'm doing wrong?
>> 
>> Thanks!
>> 
>> L.
>> 
>> PS, I've attached my config and test code for reference.
>> 
>> 
>> 
>> ----
>> 
> 
>> --
>> 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]>

Reply via email to