RE: storing query results while paging through

2006-01-23 Thread Justin D. Scott
Assuming your query pulls all of the results and you use the startrow and
maxrows attributes when outputting, you could just use the cachedwithin
attribute of cfquery itself to store the results in memory without all the
fuss of session variables.  This will also have the benefit of using the
same cache if multiple sessions search for the same thing while it's in the
cache.

-Justin



 -Original Message-
 From: George Abraham [mailto:[EMAIL PROTECTED] 
 Sent: Monday, January 23, 2006 10:34 AM
 To: CF-Talk
 Subject: storing query results while paging through
 
 All,
 I don't use session variables at all, but this might a good 
 time to use
 them.
 
 I have a search page that takes in a search term, runs a 
 query and then
 displays the results. The user is allowed to click into a 
 result and then
 page through the search resultset while in a result (via Previous/Next
 controls). Since I don't store the query results anywhere, I 
 basically run
 that query every single time that the user presses Previous 
 or Next (just so
 that I can find out where the user is while s/he is paging 
 through and what
 the previous and next results are.) For an intensive search 
 (which this is
 turning out to be), this means every time that the user does 
 anything with
 the resultset, I am running a 4 or 5 second operation. Highly 
 inefficient, I
 suspect.
 
 How do I cache the query results? Is a session variable the 
 best option? I
 guess cookies would not be bad, but they are limited in the 
 amount they can
 hold. How do people tackle this problem anyway?
 
 Thanks,
 George
 
 
 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230226
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: storing query results while paging through

2006-01-23 Thread Wayne Putterill
As a side note to this, what are the options for paging with regards
to Ajax or Flash these days? I'm just wondering if there is something
out there that I should be considering for future use.

On 1/23/06, George Abraham [EMAIL PROTECTED] wrote:
 All,
 I don't use session variables at all, but this might a good time to use
 them.

 I have a search page that takes in a search term, runs a query and then
 displays the results. The user is allowed to click into a result and then
 page through the search resultset while in a result (via Previous/Next
 controls). Since I don't store the query results anywhere, I basically run
 that query every single time that the user presses Previous or Next (just so
 that I can find out where the user is while s/he is paging through and what
 the previous and next results are.) For an intensive search (which this is
 turning out to be), this means every time that the user does anything with
 the resultset, I am running a 4 or 5 second operation. Highly inefficient, I
 suspect.

 How do I cache the query results? Is a session variable the best option? I
 guess cookies would not be bad, but they are limited in the amount they can
 hold. How do people tackle this problem anyway?

 Thanks,
 George


 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230229
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: storing query results while paging through

2006-01-23 Thread Robertson-Ravo, Neil (RX)
Well,  lots of options.  At present I am using mainly BXML/Backbase.



-Original Message-
From: Wayne Putterill [mailto:[EMAIL PROTECTED] 
Sent: 23 January 2006 16:24
To: CF-Talk
Subject: Re: storing query results while paging through

As a side note to this, what are the options for paging with regards
to Ajax or Flash these days? I'm just wondering if there is something
out there that I should be considering for future use.

On 1/23/06, George Abraham georg



[EMAIL PROTECTED] wrote:
 All,
 I don't use session variables at all, but this might a good time to use
 them.

 I have a search page that takes in a search term, runs a query and then
 displays the results. The user is allowed to click into a result and then
 page through the search resultset while in a result (via Previous/Next
 controls). Since I don't store the query results anywhere, I basically run
 that query every single time that the user presses Previous or Next (just
so
 that I can find out where the user is while s/he is paging through and
what
 the previous and next results are.) For an intensive search (which this is
 turning out to be), this means every time that the user does anything with
 the resultset, I am running a 4 or 5 second operation. Highly inefficient,
I
 suspect.

 How do I cache the query results? Is a session variable the best option? I
 guess cookies would not be bad, but they are limited in the amount they
can
 hold. How do people tackle this problem anyway?

 Thanks,
 George


 



~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230230
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: storing query results while paging through

2006-01-23 Thread George Abraham
Justin,
Suppose the query is named 'getResults' and I have enabled the cachedwithin
attribute. Say user1 comes along and searches for 'Portugal'. The query
'getResults' is cached. Then user2 comes along and searches for 'Spain'.
This happens while user1 is paging through the resultset for 'Portugal'.
Then user3 comes along (while the sessions for user1 and user2 are still on)
and searches for 'Argentina'. What happens to the cache for 'getResults'
while all this is happening? How does CFMX 7 (which I am on) handle all
these interactions for cached queries?

Thanks,
George

On 1/23/06, Justin D. Scott [EMAIL PROTECTED] wrote:

 Assuming your query pulls all of the results and you use the startrow and
 maxrows attributes when outputting, you could just use the cachedwithin
 attribute of cfquery itself to store the results in memory without all the
 fuss of session variables.  This will also have the benefit of using the
 same cache if multiple sessions search for the same thing while it's in
 the
 cache.

 -Justin



  -Original Message-
  From: George Abraham [mailto:[EMAIL PROTECTED]
  Sent: Monday, January 23, 2006 10:34 AM
  To: CF-Talk
  Subject: storing query results while paging through
 
  All,
  I don't use session variables at all, but this might a good
  time to use
  them.
 
  I have a search page that takes in a search term, runs a
  query and then
  displays the results. The user is allowed to click into a
  result and then
  page through the search resultset while in a result (via Previous/Next
  controls). Since I don't store the query results anywhere, I
  basically run
  that query every single time that the user presses Previous
  or Next (just so
  that I can find out where the user is while s/he is paging
  through and what
  the previous and next results are.) For an intensive search
  (which this is
  turning out to be), this means every time that the user does
  anything with
  the resultset, I am running a 4 or 5 second operation. Highly
  inefficient, I
  suspect.
 
  How do I cache the query results? Is a session variable the
  best option? I
  guess cookies would not be bad, but they are limited in the
  amount they can
  hold. How do people tackle this problem anyway?
 
  Thanks,
  George
 
 
 

 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230231
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: storing query results while paging through

2006-01-23 Thread Dave Watts
 Suppose the query is named 'getResults' and I have enabled 
 the cachedwithin attribute. Say user1 comes along and 
 searches for 'Portugal'. The query 'getResults' is cached. 
 Then user2 comes along and searches for 'Spain'.
 This happens while user1 is paging through the resultset for 
 'Portugal'.
 Then user3 comes along (while the sessions for user1 and 
 user2 are still on) and searches for 'Argentina'. What 
 happens to the cache for 'getResults'
 while all this is happening? How does CFMX 7 (which I am on) 
 handle all these interactions for cached queries?

When you use CACHEDWITHIN/CACHEDAFTER, CF identifies cached queries not just
by name, but by connection and by the actual SQL statement. So, each user
would generate their own cached query, and CF would only reuse one of them
if another request used one of the previously-entered search criteria.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230233
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: storing query results while paging through

2006-01-23 Thread George Abraham
On 1/23/06, Dave Watts [EMAIL PROTECTED] wrote:

 When you use CACHEDWITHIN/CACHEDAFTER, CF identifies cached queries not
 just
 by name, but by connection and by the actual SQL statement. So, each user
 would generate their own cached query, and CF would only reuse one of them
 if another request used one of the previously-entered search criteria.


Ah, so there is a diffrentiation by connection as well (hence by session)? I
knew that there was a diffrentiation by actual SQL statement. That is good
to know.

Thanks all!
George


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230234
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: storing query results while paging through

2006-01-23 Thread Justin D. Scott
The cache is based on the query name, as well as the actual query going to
the SQL server.  If the search string is different, then the query would be
different, so it would get cached independently of the others.

Note that if you are using cfqueryparam in the query, it cannot be cached
with cachedwithin.

-Justin

 

 -Original Message-
 From: George Abraham [mailto:[EMAIL PROTECTED] 
 Sent: Monday, January 23, 2006 12:13 PM
 To: CF-Talk
 Subject: Re: storing query results while paging through
 
 Justin,
 Suppose the query is named 'getResults' and I have enabled 
 the cachedwithin
 attribute. Say user1 comes along and searches for 'Portugal'. 
 The query
 'getResults' is cached. Then user2 comes along and searches 
 for 'Spain'.
 This happens while user1 is paging through the resultset for 
 'Portugal'.
 Then user3 comes along (while the sessions for user1 and 
 user2 are still on)
 and searches for 'Argentina'. What happens to the cache for 
 'getResults'
 while all this is happening? How does CFMX 7 (which I am on) 
 handle all
 these interactions for cached queries?
 
 Thanks,
 George
 
 On 1/23/06, Justin D. Scott [EMAIL PROTECTED] wrote:
 
  Assuming your query pulls all of the results and you use 
 the startrow and
  maxrows attributes when outputting, you could just use the 
 cachedwithin
  attribute of cfquery itself to store the results in memory 
 without all the
  fuss of session variables.  This will also have the benefit 
 of using the
  same cache if multiple sessions search for the same thing 
 while it's in
  the
  cache.
 
  -Justin
 
 
 
   -Original Message-
   From: George Abraham [mailto:[EMAIL PROTECTED]
   Sent: Monday, January 23, 2006 10:34 AM
   To: CF-Talk
   Subject: storing query results while paging through
  
   All,
   I don't use session variables at all, but this might a good
   time to use
   them.
  
   I have a search page that takes in a search term, runs a
   query and then
   displays the results. The user is allowed to click into a
   result and then
   page through the search resultset while in a result (via 
 Previous/Next
   controls). Since I don't store the query results anywhere, I
   basically run
   that query every single time that the user presses Previous
   or Next (just so
   that I can find out where the user is while s/he is paging
   through and what
   the previous and next results are.) For an intensive search
   (which this is
   turning out to be), this means every time that the user does
   anything with
   the resultset, I am running a 4 or 5 second operation. Highly
   inefficient, I
   suspect.
  
   How do I cache the query results? Is a session variable the
   best option? I
   guess cookies would not be bad, but they are limited in the
   amount they can
   hold. How do people tackle this problem anyway?
  
   Thanks,
   George
  
  
  
 
  
 
 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230235
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: storing query results while paging through

2006-01-23 Thread Dawson, Michael
By connection he means database connection from the CF server to the
DB server.

This is not related to a session.  Since it is not related to a session,
many users can share the *exact* same query.

M!ke 

-Original Message-
From: George Abraham [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 23, 2006 11:34 AM
To: CF-Talk
Subject: Re: storing query results while paging through

On 1/23/06, Dave Watts [EMAIL PROTECTED] wrote:

 When you use CACHEDWITHIN/CACHEDAFTER, CF identifies cached queries 
 not just by name, but by connection and by the actual SQL statement. 
 So, each user would generate their own cached query, and CF would only

 reuse one of them if another request used one of the 
 previously-entered search criteria.


Ah, so there is a diffrentiation by connection as well (hence by
session)? I knew that there was a diffrentiation by actual SQL
statement. That is good to know.

Thanks all!
George

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230236
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: storing query results while paging through

2006-01-23 Thread Dave Watts
 Ah, so there is a diffrentiation by connection as well (hence 
 by session)? I knew that there was a diffrentiation by actual 
 SQL statement. That is good to know.

Well, I oversimplified a bit when I said connection. CF uses the
connection information - username, password, datasource - to differentiate
queries.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230237
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: storing query results while paging through

2006-01-23 Thread Burns, John D
Dave-

When you say it differentiats by the actual SQL, does that include
cfqueryparams? Or is the sql considered the same just with different
params? I had some problems at one point and thought that might be the
issue. I was just curious if you knew. 


John Burns
Certified Advanced ColdFusion MX Developer
Wyle Laboratories, Inc. | Web Developer
 

-Original Message-
From: Dave Watts [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 23, 2006 12:44 PM
To: CF-Talk
Subject: RE: storing query results while paging through

 Ah, so there is a diffrentiation by connection as well (hence by 
 session)? I knew that there was a diffrentiation by actual SQL 
 statement. That is good to know.

Well, I oversimplified a bit when I said connection. CF uses the
connection information - username, password, datasource - to
differentiate queries.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta, Chicago,
Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!




~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230239
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: storing query results while paging through

2006-01-23 Thread George Abraham
Well,
I completely forgot that we were using stored procedures for our db calls.
So the cachedwithin property goes out the window. Now I am just storing the
storedproc results in the session scope and using them from there.

Thanks,
George

On 1/23/06, Justin D. Scott [EMAIL PROTECTED] wrote:

 The cache is based on the query name, as well as the actual query going to
 the SQL server.  If the search string is different, then the query would
 be
 different, so it would get cached independently of the others.

 Note that if you are using cfqueryparam in the query, it cannot be cached
 with cachedwithin.

 -Justin



  -Original Message-
  From: George Abraham [mailto:[EMAIL PROTECTED]
  Sent: Monday, January 23, 2006 12:13 PM
  To: CF-Talk
  Subject: Re: storing query results while paging through
 
  Justin,
  Suppose the query is named 'getResults' and I have enabled
  the cachedwithin
  attribute. Say user1 comes along and searches for 'Portugal'.
  The query
  'getResults' is cached. Then user2 comes along and searches
  for 'Spain'.
  This happens while user1 is paging through the resultset for
  'Portugal'.
  Then user3 comes along (while the sessions for user1 and
  user2 are still on)
  and searches for 'Argentina'. What happens to the cache for
  'getResults'
  while all this is happening? How does CFMX 7 (which I am on)
  handle all
  these interactions for cached queries?
 
  Thanks,
  George
 
  On 1/23/06, Justin D. Scott [EMAIL PROTECTED] wrote:
  
   Assuming your query pulls all of the results and you use
  the startrow and
   maxrows attributes when outputting, you could just use the
  cachedwithin
   attribute of cfquery itself to store the results in memory
  without all the
   fuss of session variables.  This will also have the benefit
  of using the
   same cache if multiple sessions search for the same thing
  while it's in
   the
   cache.
  
   -Justin
  
  
  
-Original Message-
From: George Abraham [mailto:[EMAIL PROTECTED]
Sent: Monday, January 23, 2006 10:34 AM
To: CF-Talk
Subject: storing query results while paging through
   
All,
I don't use session variables at all, but this might a good
time to use
them.
   
I have a search page that takes in a search term, runs a
query and then
displays the results. The user is allowed to click into a
result and then
page through the search resultset while in a result (via
  Previous/Next
controls). Since I don't store the query results anywhere, I
basically run
that query every single time that the user presses Previous
or Next (just so
that I can find out where the user is while s/he is paging
through and what
the previous and next results are.) For an intensive search
(which this is
turning out to be), this means every time that the user does
anything with
the resultset, I am running a 4 or 5 second operation. Highly
inefficient, I
suspect.
   
How do I cache the query results? Is a session variable the
best option? I
guess cookies would not be bad, but they are limited in the
amount they can
hold. How do people tackle this problem anyway?
   
Thanks,
George
   
   
   
  
  
 
 

 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230242
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: storing query results while paging through

2006-01-23 Thread Dave Watts
 When you say it differentiats by the actual SQL, does that 
 include cfqueryparams? Or is the sql considered the same just 
 with different params? I had some problems at one point and 
 thought that might be the issue. I was just curious if you knew.

For some reason, the CACHEDWITHIN/CACHEDAFTER attributes cannot be used with
queries that contain CFQUERYPARAMs. This is kind of a bummer.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230243
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: storing query results while paging through

2006-01-23 Thread Will Tomlinson
For some reason, the CACHEDWITHIN/CACHEDAFTER attributes cannot be used with
queries that contain CFQUERYPARAMs. This is kind of a bummer.

It can be done according to Mark Kruger. He blogged the technique here:

http://mkruger.cfwebtools.com/index.cfm?mode=entryentry=F1B29E12-9424-1650-BA023EEB6224B18C

Will

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230289
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: storing query results while paging through

2006-01-23 Thread Dave Watts
  For some reason, the CACHEDWITHIN/CACHEDAFTER attributes 
  cannot be used with queries that contain CFQUERYPARAMs. ...

 It can be done according to Mark Kruger. He blogged the 
 technique here: ...

While that's pretty nifty, it's not using CFQUERYPARAM, and it doesn't
provide the two primary benefits that CFQUERYPARAM does. Read through the
comments on Mark's blog for details.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230291
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54