Adrian,
Have you trieddoing a read-only query?

results = oql.execute(Database.ReadOnly); 

Hope this helps-
Margaret

-----Original Message-----
From: Adrian Nistor [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 6:26 PM
To: [EMAIL PROTECTED]
Subject: [castor-dev] How can I make an object bo become transient after
I retrieved with an OQL query



I have next sequence of code:

====================
...
AccountData account;

InitialContext ic = new InitialContext();
DataObjects jdo = (DataObjects) ic.lookup(JDO_JNDI);
Database db = jdo.getDatabase();

oql = db.getOQLQuery("SELECT a FROM AccountData a WHERE UserName=$1");
oql.bind("user");
results = oql.execute();
while ( results.hasMore() )
{
  account = (AccountData) results.next();
}
...
====================


    This a simple OQL query. As a result I get an object "account" of type 
"AcountData". If I modify any field of this object it will be persisted 
(autoStore is false) which normally is fine.
    But in some situations I would like to alter my object without
persisting the data in the DB. How can I do that? How can I make it
transient without persisting it in the DB. I cannot call commit() and do the

job after that because I'm in an EJB BMP. Thanks!

Adrian


_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to