You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Sy...@swisscom.com on 2003/03/25 14:51:32 UTC

PB: how to obtain a Broker instance

Hello,

In the PB tutorial (tutorial1) the author explains how to obtain a Broker instance:

You put the code below in the constructor of your class.

----code----
public MyClass()
{
    PersistenceBroker broker = null;
    try
    {
        broker = PersistenceBrokerFactory.
                    defaultPersistenceBroker();
    }
    catch (Throwable t)
    {
        t.printStackTrace();
    }
}
----code----

I don't understand how the PB instance is passed to the constructor of other classes in this example.

My situation is: a class (the controller) creates an instance of a JavaBean. I want to create the PB instance in this JavaBean. How to store the PB instance?


Someone could give me advices about that?

Thanks
Sylvain