[Opensource] Expresso DBObjects - Serious error in caching or something else?

Gabor Nagypal nagypal at web.de
Mon Aug 11 23:56:30 PDT 2003


Hi!

One additional remark: if I "save" the DBObject (e.g. with update() or 
addOrUpdate() ) then the next read uses null values well again. I 
suppose it clears the cache.

So:

DBObject dbo = new MyDbo();
dbo.setField("id","1");
dbo.retrieve();
dbo.addOrUpdate();
dbo.isFieldNull("dummy"); -> gives back TRUE
DBObject dbo = new MyDbo();
dbo.setField("id","1");
dbo.retrieve();
dbo.isFieldNull("dummy"); -> gives back TRUE

Of course it is not a solution, because it means that for each read 
access you also have to write the DB, which is extremely inefficient.

Regards,

Gabor

Gabor Nagypal wrote:
> Hi!
> 
> I use Expresso 5.0.5 and I have the following problem:
> 
> I have a DBObject, let's say MyDbo, which has an attribute "id" as DB 
> key, and "dummy", which can be null.
> I have a raw in the DB where the attribute "dummy" is null. Let's say 
> the is for this raw is '1'. Now:
> 
> DBObject dbo = new MyDbo();
> dbo.setField("id","1");
> dbo.retrieve();
> dbo.isFieldNull("dummy"); -> gives back TRUE
> DBObject dbo = new MyDbo();
> dbo.setField("id","1");
> dbo.retrieve();
> dbo.isFieldNull("dummy"); -> gives back FALSE (with getField I get an 
> empty, but non-null string)
> 
> So what happens: I read the same row from the DB in one application, in 
> one thread. I do not change the DB between the two read operations, I 
> use a new instance of dbo to avoid any interference. However, for the 
> first time Expresso says that the attribute "dummy" is null (which is 
> right) but for the second time it says the field is not null.
> 
> What is that? Do I miss something here, or is it a critical error in 
> Expresso caching code?
> 
> Anyway: I use PostgreSQL as a background DB...
> 
> Regards,
> 
> Gabor
> 
> _______________________________________________
> Opensource mailing list
> Opensource at jcorporate.com
> http://mail.jcorporate.com/mailman/listinfo/opensource
> Archives: http://mail.jcorporate.com/pipermail/opensource/
> 




More information about the Opensource mailing list