cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff de Vries <>
Subject Re: Caching problem?
Date Fri, 19 May 2006 22:05:00 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<body bgcolor="#ffffff" text="#000000">
I get the following compile error (I'm using Cayenne 1.2):<br>
&nbsp; The method performQuery(Query) in the type DataContext is not
applicable for the arguments (SelectQuery, boolean)<br>
I tried to find something equivalent for Cayenne 1.2 but didn't
recognize anything.<br>
Gentry, Michael (Contractor) wrote:
  <pre wrap="">Could you try:

		List result = dc.performQuery(query, true);

And see if it works better?



-----Original Message-----
From: Jeff de Vries [<a class="moz-txt-link-freetext" href=""></a>]

Sent: Friday, May 19, 2006 12:18 PM
To: <a class="moz-txt-link-abbreviated" href=""></a>
Subject: Re: Caching problem?

It's pretty straightforward.  In the following code Person is the  
parent, and Alert is the child.  There are actually many Alert  
classes (I'm using Cayenne STI), so the specific Alert class we're  
interested in is passed as a parameter.  Also, I forgot to mention  
that if we shut everything down, and then restart, we do see the  
modified status (presumably because Cayenne really had to go back to  
the database to get the data for the child list).

	 * Finds all Alerts of the given type sent to the given person
	 * @param person
	 *            Person to find Alerts for
	 * @param include_hidden
	 *            If true, include hidden alerts as well
	 * @param alert_subclass
	 *            Class of alert to search for
	 * @return List of alert objects, of given type, for the given
	protected static List findFor(Person person, boolean
Class alert_subclass) {
		DataContext dc = DataContext.getThreadDataContext();
		SelectQuery query = new SelectQuery(alert_subclass);
query.setQualifier(ExpressionFactory.matchExp("toReceiver", person));
new Boolean 
		if (!include_hidden)
query.andQualifier(ExpressionFactory.matchExp("hidden",new Boolean 
		List result = dc.performQuery(query);
		return result;

On May 19, 2006, at 6:05 AM, Gentry, Michael ((Contractor)) wrote:

  <blockquote type="cite">
    <pre wrap="">Jeff, could you post the code where you are doing the second query?



-----Original Message-----
From: Jeff de Vries [<a class="moz-txt-link-freetext" href=""></a>]
Sent: Friday, May 19, 2006 12:09 AM
To: <a class="moz-txt-link-abbreviated" href=""></a>
Subject: Caching problem?

Simplified version:  I have a parent table and a child table, where  
child table has a parent_id column and a status column.  I change the
status in one of the child records and commit the change.  Later, I  
for the child records for the given parent record, but the child  
that I get back on which I changed the status still has the *old*  

instead of the new status.  If I look at the database, the child  
does have the new status (and in fact I can see the update and  
commit as

soon as I commit the child record change).

Why is the parent still seeing the old child status?  An additional  

is that I'm not using parent.getChildArray() but rather a
SelectQuery(Child) that matches toParent to the parent I'm interested

(This is in Cayenne 1.2B2 using PostgreSQL 8.1)


  <pre wrap=""><!---->

View raw message