Hi,

----- Original Message -----
From: "Xu Jie" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 07, 2003 9:53 PM
Subject: Question on Tutorial1


>
> All,
>
> I am new to this ObJectRelationalBridge (OJB) project. So I used
Tutorial1
> to teach myself something about OJB. It works fine according to the
online
> doc in my DOS console. Next I did is to move only needed files (jar,
xml
> ...) to my development environment. After some work, the Tutorial
starts
> working in my development environment with one interesting exception.
I have
> to use option 1 first to enter new record. If I use option 0 to view
list
> first, I will get following message when I try to enter new one,
> [org.apache.ojb.broker.accesslayer.ConnectionManagerImpl] INFO:
Rollback was
> called, do rollback on current connection
[EMAIL PROTECTED]
> ConnectionManager is NOT in transaction
> But if I do option 1 first, I do not see any problem at all.

Hhm, do you use multiple threads and share the
same broker?
Tutorial1 use a 'special' construct to show single
aspects of OJB. In 'real life' you should use OJB
in an more simple manner

PersistenceBroker broker =
PersistenceBrokerFactory.defaultPersistenceBroker();
try{
broker.beginTransaction();
broker.store(anObject);
broker.commitTransaction()
}catch(PersistenceBrokerException e)
{
broker.abortTransaction()
}
finally
{
broker.close();
}

PersistenceBroker instances are pooled, thus PB lookup
has no performance impact. PB instance itself is not
thread safe. Use one PB instance per thread or on
every method call.

HTH
regards,
Armin
> Thank you for your help,
>
>
>
>
> ----------------------------------------------------------------------
---------
> This message and any included attachments are from Siemens Medical
Solutions
> USA, Inc. and are intended only for the addressee(s).
> The information contained herein may include trade secrets or
privileged or
> otherwise confidential information.  Unauthorized review, forwarding,
printing,
> copying, distributing, or using such information is strictly
prohibited and may
> be unlawful.  If you received this message in error, or have reason to
believe
> you are not authorized to receive it, please promptly delete this
message and
> notify the sender by e-mail with a copy to [EMAIL PROTECTED]  Thank
you
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to