db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Hansen <steve.han...@sinex.com>
Subject Re: Transaction Error: Postgresql <=> Torque
Date Mon, 13 Jan 2003 14:59:18 GMT
Hello,

When I've seen errors like this it usually means I've miss configured
the runtime configuration file. When torque is complaining a database is
not using transactions ..
 WARN - IDBroker is being used with db 'bookstore',
>  which does not support transactions.                 <--- for Postgresql ?????It
is not saying the RDBMS does not support transactions, its telling us, for some 
reason IDBroker can not use transactions with the db 'bookstore' it
found defined in our configuration, there are probably many possible
reasons for this but I've run into 1) bad configuation of the database,
and 2) incorrect login information as the most common problems.

Steve
On Sun, 2003-01-12 at 20:44, goffredo wrote:
> Hi,
> 
But when I tried to run it I got a mysterious error, a warning
> in the torque.log stating that the Postgresql 'bookstore' database
> does not support transactions (???) Of course Postgresql supports
> transactions ... I am not sure at all where the problem lies - my
> configuration, my startup of Postgresql - or what - I enclose the 
> relevant notes, perhaps someone can spot the fault right away ... and
> let me know 
> 
> Regards
> goffredo
> 
> Error Message :
> ---------------
> 
> java.lang.NullPointerException: Connection object was null.
>  This could be due to a misconfiguration of the DataSourceFactory.
>  Check the logs and Torque.properties to better determine the cause.
>     at org.apache.torque.util.Transaction.rollback(Transaction.java:179)
>     at org.apache.torque.util.Transaction.safeRollback(Transaction.java:221)
>     at org.armida.mbrowser.torque.om.BasePublisher.save(BasePublisher.java:426)
>     at org.armida.mbrowser.torque.om.BasePublisher.save(BasePublisher.java:401)
>     at Bookstore.main(Bookstore.java:26)
> 
> 
> Offending Class :
> -----------------
>     public void save(String dbName) throws TorqueException
>     {
>         Connection con = null;
>          try
>         {
>             con = Transaction.begin(dbName);
>             save(con);
>             Transaction.commit(con);
>         }
>         catch(TorqueException e)
>         {
>             Transaction.safeRollback(con);    [ <--- line 179 ]
>             throw e;
>         }
> 
>      }
> 
> Last Few Lines of torque.log :
> ------------------------------
> 
> [...]
> DEBUG -   Using converter 
> org.apache.commons.beanutils.converters.StringConverter@3901c6
> DEBUG - Adding a dummy entry for default, mapped onto bookstore
> DEBUG - IDBroker thread was started.
> WARN - IDBroker is being used with db 'bookstore',
>  which does not support transactions.                 <--- for Postgresql ??????
>  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.
> 
> 
> torque.properties :
> -------------------
> 
> torque.applicationRoot = .
> 
> log4j.category.org.apache.torque = ALL, org.apache.torque
> log4j.appender.org.apache.torque = org.apache.log4j.FileAppender
> log4j.appender.org.apache.torque.file = 
> ${torque.applicationRoot}/logs/torque.log
> log4j.appender.org.apache.torque.layout = org.apache.log4j.PatternLayout
> log4j.appender.org.apache.torque.layout.conversionPattern = %d [%t] %-5p %c - %
> m%n
> log4j.appender.org.apache.torque.append = false
> 
> torque.database.default=bookstore
> torque.database.bookstore.adapter=postgresql
> 
> log4j.rootCategory = DEBUG, default
> log4j.appender.default = org.apache.log4j.FileAppender
> log4j.appender.default.file = ./torque.log
> log4j.appender.default.layout = org.apache.log4j.SimpleLayout
> 
> 
> ## Using Jdbc2Pool
> torque.dsfactory.bookstore.factory=\
>   org.apache.torque.dsfactory.Jdbc2PoolDataSourceFactory
> torque.dsfactory.bookstore.pool.defaultMaxActive=10
> torque.dsfactory.bookstore.pool.testOnBorrow=true
> torque.dsfactory.bookstore.pool.validationQuery=SELECT 1
> torque.database.bookstore.driver = org.postgresql.Driver
> torque.database.bookstore.url = jdbc:postgresql://192.168.1.1:5432/bookstore
> torque.dsfactory.bookstore.connection.user = <user>
> torque.dsfactory.bookstore.connection.password = <password>
> 
> torque.idbroker.cleverquantity=true
> torque.manager.useCache = true
> 
> 
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:turbine-torque-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:turbine-torque-user-help@jakarta.apache.org>
> 
> 



Mime
View raw message