Re: Generating appopriate transaction IDs
Any aversion to using an auto-increment integer field (if one exists, that is)? I basically use this as a transaction ID in one of my apps. Fawzi Amadu wrote: I am building a electronic advertisement site and I need to generate transaction IDs. Since the page will hopefully be a high volume site, I am wondering the best form of generating transaction IDs. I was considering rand function, but I read that the randrange has an upper recommended upper limit of 100,000,000. TIA ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323215 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Generating appopriate transaction IDs
I am building a electronic advertisement site and I need to generate transaction IDs. Since the page will hopefully be a high volume site, I am wondering the best form of generating transaction IDs. I was considering rand function, but I read that the randrange has an upper recommended upper limit of 100,000,000. TIA ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323153 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Generating appopriate transaction IDs
getTickcount() or createUuid() ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323154 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Generating appopriate transaction IDs
I've been using createuuid() for a little while now and I haven't encountered any issues. I like it because you don't have as many smart asses trying to go in and change the id in the querystring. :) -- Ryan On Thu, Jun 4, 2009 at 6:28 AM, Peter Boughton bought...@gmail.com wrote: getTickcount() or createUuid() ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323156 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Generating appopriate transaction IDs
getTickcount() or createUuid() You'll run into dupes pretty quickly by using getTickCount() since it resets back to 1 every time the server restarts. Not recommended. CreateUUID() would work much better if you don't want integer only IDs. -Justin ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323178 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Generating appopriate transaction IDs
The other benefit of createUUID() is that you can later split / combine records from different tables if you ever need to, such as pulling production records down to review in development ... no integer clashes when you've got fully unique values across the tables and datasources. From: Justin Scott jscott-li...@gravityfree.com Sent: Thursday, June 04, 2009 12:42 PM To: cf-talk cf-talk@houseoffusion.com Subject: RE: Generating appopriate transaction IDs getTickcount() or createUuid() You'll run into dupes pretty quickly by using getTickCount() since it resets back to 1 every time the server restarts. Not recommended. CreateUUID() would work much better if you don't want integer only IDs. -Justin ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323179 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Generating appopriate transaction IDs
Just as a note, CreateUUID does have a downside http://kb2.adobe.com/cps/190/tn_19007.html http://kb2.adobe.com/cps/190/tn_19007.htmlEspecially if it's on a very high volume site. Not sure if this has been addressed in later versions of CF. =] -- Alan Rother Adobe Certified Advanced ColdFusion MX 7 Developer Manager, Phoenix Cold Fusion User Group, AZCFUG.org ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323180 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Generating appopriate transaction IDs
Looks like that was fixed in JVM 1.3.1_04 ... and CF 8 is shipped with 1.6.0_4, with the recommendation to upgrade to 1.6.0_11 or higher, so I think we're OK on the server clock issue (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4500388). Fascinating, though. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323184 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Generating appopriate transaction IDs
it resets back to 1 every time the server restarts. Huh? I was under the impression it was number of milliseconds since the unix epoch (1-Jan-1970). Certainly that's what Railo is returning, and no resetting after restart there. I'm 99% certain that CF7 acts in the same way. The CF docs are a bit vague/contradictory on it though: Description - Returns the current value of an internal millisecond timer. Returns - A string representation of the system time, in milliseconds. Usage - The value of the counter has no meaning. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323187 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Generating appopriate transaction IDs
I just fired up Tomcat and tried getTickCount() on all 3 CFML engines within a second or two of each other. OpenBD: 276282Railo: 1244157288529cfusion: 1244157287685 Running date +%s on my linux box gives me 1244157286 so it looks like cfusion and Railo do indeed return milliseconds since the epoch. This may not have always been the case, hence the fuzzy documentation. -Ryan From: Peter Boughton bought...@gmail.com Sent: Thursday, June 04, 2009 4:43 PM To: cf-talk cf-talk@houseoffusion.com Subject: Re: Generating appopriate transaction IDs it resets back to 1 every time the server restarts. Huh? I was under the impression it was number of milliseconds since the unix epoch (1-Jan-1970). Certainly that's what Railo is returning, and no resetting after restart there. I'm 99% certain that CF7 acts in the same way. The CF docs are a bit vague/contradictory on it though: Description - Returns the current value of an internal millisecond timer. Returns - A string representation of the system time, in milliseconds. Usage - The value of the counter has no meaning. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323188 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Generating appopriate transaction IDs
Eh sorry my webmail sucks, lets see if this one comes through formatted better. __ I just fired up Tomcat and tried getTickCount() on all 3 CFML engines within a second or two of each other. OpenBD: 276282 Railo: 1244157288529 cfusion: 1244157287685 Running date +%s on my linux box gives me 1244157286 so it looks like cfusion and Railo do indeed return milliseconds since the epoch. This may not have always been the case, hence the fuzzy documentation. -Ryan From: Peter Boughton Sent: Thursday, June 04, 2009 4:43 PM To: cf-talk Subject: Re: Generating appopriate transaction IDs it resets back to 1 every time the server restarts. Huh? I was under the impression it was number of milliseconds since the unix epoch (1-Jan-1970). Certainly that's what Railo is returning, and no resetting after restart there. I'm 99% certain that CF7 acts in the same way. The CF docs are a bit vague/contradictory on it though: Description - Returns the current value of an internal millisecond timer. Returns - A string representation of the system time, in milliseconds. Usage - The value of the counter has no meaning. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323189 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Generating appopriate transaction IDs
Railo: 1244157288529 cfusion: 1244157287685 I was remembering back in the CF4/5 days where it returned the ms count since the application server was started. Or maybe my memory is starting to go (ack!). Good to know for the future. -Justin ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323192 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4