You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by touchmyheart <to...@eastday.com> on 2002/07/09 04:55:24 UTC
How to use the decoupled Torque in Jetspeed?(Repost)
I am following the instruction in the page
http://jakarta.apache.org/turbine/torque/tutorial.html
after generating all the peer class,the Bookstore.java can use the generated
class to do some work,my standalone application 'Bookstore' run correctly,
now I want to run my peer class in my porlet which run in Jetspeed.
so I inserted a new row value into the table 'ID_TABLE' in my jetspeed
default
database,and created the other tables corresponding my peer classes.
I tried to use the peer class directly in the action class of my Portlet
like
below:
................
Publisher addison = new Publisher();
addison.setName("Addison Wesley Professional");
addison.save();
................
but the error happened,in Jetspeed.log file:
[15:48:01,216 WARN ] IDBroker is being used with db 'bookstore',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.
[15:48:01,226 INFO ] IDBroker thread was started.
[15:48:01,296 WARN ] A DBConnection was finalized, without being returned to
the ConnectionPool it belonged to
......................................
I dont know what happened.
in the standalone appliction,Bookstore.java source code:
_______________________________________
public class Bookstore
{
public static void main(String[] args)
{
try
{
/*
* Initializing Torque
*/
Torque.init("Torque.properties");
.............
my question is:
in Jetspeed,do i need to write some code instead of
'Torque.init("Torque.properties")'?
any responding would be appreciated!
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: How to use the decoupled Torque in Jetspeed?(Repost)
Posted by Chris Kimpton <ki...@yahoo.com>.
Hi,
--- touchmyheart <to...@eastday.com> wrote:
>
> but the error happened,in Jetspeed.log file:
>
> [15:48:01,216 WARN ] IDBroker is being used with db
> 'bookstore',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.
> [15:48:01,226 INFO ] IDBroker thread was started.
> [15:48:01,296 WARN ] A DBConnection was finalized, without being
> returned to
> the ConnectionPool it belonged to
> ......................................
>
I don't see any errors - just 2 WARNings and an INFO message.
The first WARN says you are using a db that does not support
transactions - probably hsql.
The second WARN seems wierd as you don't seem to be getting any
connections and thus cannot be faulted for not releasing them ;-)
Which means it might be a Torque internal problem - so try the
torque-user mailing list.
> /*
> * Initializing Torque
> */
> Torque.init("Torque.properties");
>
> .............
>
> my question is:
>
> in Jetspeed,do i need to write some code instead of
> 'Torque.init("Torque.properties")'?
>
Torque multiple DB connections, if you are working with the "default"
connection that jetspeed uses then this is not required in your code.
In fact, I think if you put your Torque config into the
Torque.properties file used by jetspeed it will get bootstrapped
(init'd) for you.
I am assuming that you are using the latest jetspeed from CVS that
uses Torque too?
HTH,
Chris
=====
__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>