Welcome Guest, Not a member yet? Register   Sign In
XML-RPC memory leak question..
#24

[eluser]TheFuzzy0ne[/eluser]
One more thing I should point out that may make your job more difficult, but should not be ignored, are race conditions.

If the client is grabbing various pages and more data is inserted into the database during this process, it may mean that the client gets one or more rows of duplicate data.

It could also work the other way if a row were deleted, in which case the client may skip one or more rows of data.

I'm not sure if the above really matters that much, but if it does, there are some solutions. Using hashes to compare data would probably work. The client could send an id and the data hashed, the server could pull out all of those entries, and return the ones that have changed based on the supplied hash, along with information about any of the rows that may have been deleted. Sorry for complicating everything.

Another way to get around this (just to complicate things further), is that your script is hardlimited, as you are coding now, so it will only give out x number of results. Instead of the client requesting a page number, it requests an ID.

So starting from the top, let's assume that client requests ID 1 (which would essentially be the first page). The server would check, and grab the first x number of results where the ID is more than, or equal to 1 (order by id of course). The server passes it back to the client, the client does whatever it needs to do, and then makes a request again to the server, for ID (insert last ID received here) +1. Using this method will ensure that order of the returned dataset won't change. Any products added during the process will of course be picked up on the last page, because if you're using auto increment in your column, new rows will always be inserted at the end.

Hope this helps.


Messages In This Thread
XML-RPC memory leak question.. - by El Forum - 02-18-2009, 12:25 PM
XML-RPC memory leak question.. - by El Forum - 02-18-2009, 12:51 PM
XML-RPC memory leak question.. - by El Forum - 02-18-2009, 10:02 PM
XML-RPC memory leak question.. - by El Forum - 02-19-2009, 02:34 AM
XML-RPC memory leak question.. - by El Forum - 02-19-2009, 03:39 AM
XML-RPC memory leak question.. - by El Forum - 02-19-2009, 03:55 AM
XML-RPC memory leak question.. - by El Forum - 02-19-2009, 04:21 AM
XML-RPC memory leak question.. - by El Forum - 02-19-2009, 04:33 AM
XML-RPC memory leak question.. - by El Forum - 02-19-2009, 04:41 AM
XML-RPC memory leak question.. - by El Forum - 02-19-2009, 04:48 AM
XML-RPC memory leak question.. - by El Forum - 02-19-2009, 04:52 AM
XML-RPC memory leak question.. - by El Forum - 02-19-2009, 05:01 AM
XML-RPC memory leak question.. - by El Forum - 02-19-2009, 05:08 AM
XML-RPC memory leak question.. - by El Forum - 02-19-2009, 05:11 AM
XML-RPC memory leak question.. - by El Forum - 02-19-2009, 05:12 AM
XML-RPC memory leak question.. - by El Forum - 02-19-2009, 05:15 AM
XML-RPC memory leak question.. - by El Forum - 02-19-2009, 05:59 AM
XML-RPC memory leak question.. - by El Forum - 02-19-2009, 06:25 AM
XML-RPC memory leak question.. - by El Forum - 02-19-2009, 06:30 AM
XML-RPC memory leak question.. - by El Forum - 02-19-2009, 06:41 AM
XML-RPC memory leak question.. - by El Forum - 02-19-2009, 06:52 AM
XML-RPC memory leak question.. - by El Forum - 02-19-2009, 07:13 AM
XML-RPC memory leak question.. - by El Forum - 02-19-2009, 07:24 AM
XML-RPC memory leak question.. - by El Forum - 02-19-2009, 07:52 AM
XML-RPC memory leak question.. - by El Forum - 02-19-2009, 08:30 AM
XML-RPC memory leak question.. - by El Forum - 02-19-2009, 08:36 AM
XML-RPC memory leak question.. - by El Forum - 02-20-2009, 12:27 AM
XML-RPC memory leak question.. - by El Forum - 02-20-2009, 03:31 AM
XML-RPC memory leak question.. - by El Forum - 10-13-2009, 02:36 PM
XML-RPC memory leak question.. - by El Forum - 01-25-2010, 08:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB