RE: PersistenceBroker State Question

2003-03-28 Thread Jacob Hookom
Thanks! I had just noticed it seemed to be different from earlier releases
(unless I missed something) with transaction state and closing.

-Jacob

| -Original Message-
| From: Lance Eason [mailto:[EMAIL PROTECTED]
| Sent: Friday, March 28, 2003 12:25 PM
| To: OJB Users List
| Subject: RE: PersistenceBroker State Question
| 
| It all depends on the cache you use (specified in OJB.properties).
| ObjectCacheDefaultImpl will never get flushed automatically (which can be
| problematic for transactional isolation).  ObjectCachePerBrokerImpl will
| get flushed on broker.close().
| 
| -Original Message-
| From: Jacob Hookom [mailto:[EMAIL PROTECTED]
| Sent: Friday, March 28, 2003 11:29 AM
| To: [EMAIL PROTECTED]
| Subject: PersistenceBroker State Question
| 
| 
| Pertaining to caching and speed of the PersistenceBroker, am I on the
| right
| track for structuring calls like so:
| 
| // Method OjbUserDao.insertUser()
| public void insertUser(User user) throws Exception
| {
|   // calls PersistenceBrokerFactory.defaultPersistenceBroker()
|   PersistenceBroker broker =
| OjbDaoFactory.getInstance().createBroker();
|   try
|   {
|   broker.beginTransaction();
|   broker.store(user, ObjectModificationDefaultImpl.INSERT);
|   broker.commitTransaction();
|   }
|   finally
|   {
|   broker.close();
|   }
| }
| 
| Does the cache in general get flushed when I call broker.close()? I'm just
| using the Broker in Single-VM mode.
| 
| Regards,
| Jacob Hookom
| Student, University of Wisconsin
| 
| 
| 
| -
| 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]


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



RE: PersistenceBroker State Question

2003-03-28 Thread Lance Eason
It all depends on the cache you use (specified in OJB.properties).  
ObjectCacheDefaultImpl will never get flushed automatically (which can be problematic 
for transactional isolation).  ObjectCachePerBrokerImpl will get flushed on 
broker.close().

-Original Message-
From: Jacob Hookom [mailto:[EMAIL PROTECTED]
Sent: Friday, March 28, 2003 11:29 AM
To: [EMAIL PROTECTED]
Subject: PersistenceBroker State Question


Pertaining to caching and speed of the PersistenceBroker, am I on the right
track for structuring calls like so:

// Method OjbUserDao.insertUser()
public void insertUser(User user) throws Exception
{
// calls PersistenceBrokerFactory.defaultPersistenceBroker()
PersistenceBroker broker =
OjbDaoFactory.getInstance().createBroker();
try
{
broker.beginTransaction();
broker.store(user, ObjectModificationDefaultImpl.INSERT);
broker.commitTransaction();
}
finally
{
broker.close();
}
}

Does the cache in general get flushed when I call broker.close()? I'm just
using the Broker in Single-VM mode.

Regards,
Jacob Hookom
Student, University of Wisconsin



-
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]