Internationalization of Week() function in CF - Last resort to Java
I'm developing a scheduling application in CF. While doing so, I've discovered that there are a variety of different methods for determining the week number, and that depending on the locale, a week can begin on Saturday, Sunday or Monday. The first week of the year can be determined in a variety of ways, and can be numbered in a variety of ways, such that January 1 of a given year might be in week 0, 1, 52 or 53. Complicating this somewhat is that there is no clear indication which standard CF's inbuilt Week() function follows. All this might not seem so important to Americans, but here in Europe, week numbers are often used in calenders and agendas. A question such as Can we arrange a meeting during week 43? can be rather common. The question, for me, was What standard is followed in Europe to determine week numbers. The closest thing I found to a universal standard is the ISO week date system, and I decided that's good enough for me. Reading the technical definition makes it sound pretty complex, but it can be reduced to weeks start on monday and the first week of the year is the first week with work days in it, which effectively means the week that contains January 4. There's a ISOWeek function on cflib that tries, but fails to generate the correct ISO week number some years. Long story short, I eventually solved this, as a last resort, by dropping down to Java. I'm an absolute novice at Java and wanted to ask if anyone could improve on the UDF I came up with before I submit it to CFLib ... cfscript function ISOWeek(inputDateObj) { var inputDate = DateFormat(inputDateObj,-mm-dd); var formatter = CreateObject(java,java.text.SimpleDateFormat).init(-MM-dd); var theDate = formatter.parse(inputDate); c = CreateObject(java,java.util.Calendar).getInstance(); c.setTimeInMillis(theDate.getTime()); c.setFirstDayOfWeek(c.MONDAY); c.setMinimalDaysInFirstWeek(4); return c.get(c.WEEK_OF_YEAR); } /cfscript ... using the following references and a good measure of fumbling around. http://www.jarvana.com/jarvana/view/com/h2database/h2/1.2.128/h2-1.2.128-sources.jar!/org/h2/util/DateTimeIso8601Utils.java?format=ok http://www.java2s.com/Tutorial/Java/0040__Data-Type/CreateajavautilDateObjectfromaYearMonthDayFormat.htm http://www.coldfusionmuse.com/index.cfm/2009/2/23/Unpacking-Java-In-Coldfusion I also want to suggest that Week() is internationalized appropriately in CF as an enhancement request. Thanks, Nando -- Nando M. Breiter Aria Media CP 234 6934 Bioggio Switzerland +41 91 606 6372 www.aria-media.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340201 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
More rewrite rule fun
Ok regex gurus. here's what I have. I'm using IsapiRewrite (Helicon) on an IIS server. I have links like the following: http://domain/model/parts/subcat1/subcat2/subcat3/subcat4/subcat5 From 1 to 6 levels of sub categories. My rule finds parts and the model .. So I need a rule that gives me the rest of the url (everything after /parts/) and directs it to my controller - which figures out what to display. Here's what I have that works for the first level.. RewriteRule ^([^/]*)/parts(/)?$ /controllerScript.cfm?prodtype=productdisplayaction=displayProductCategorie smodel=$1 [L,QSA] So what do I need to work with subsequent levels. I'm trying to add something to the end of /parts(/)?$ . like (/*) or (/)*? . something that variablizes the rest of the URL .but I'm falling flat. Any rewrite gurus out there know what I'm doing wrong? Will I need a rule for each possible level maybe? -mark Mark A. Kruger, MCSE, CFG (402) 408-3733 ext 105 Skype: markakruger http://www.cfwebtools.com www.cfwebtools.com http://www.coldfusionmuse.com www.coldfusionmuse.com http://www.necfug.com/ www.necfug.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340202 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: More rewrite rule fun
Mark, If your regex ^([^/]*)/parts(/)?$ captures anything after the parts/, you have a bad regex engine. You probably want something like this: ^.*/parts/([\w/]+)$ Using the same replace pattern, you will end up with /controllerScript.cfm?prodtype=productdisplayaction=displayProductCategoriesmodel=subcategory1/subcategory2/subcat3 Not sure if that's what you're going for, but a bad response is better than no response from the list ;) nathan strutz [http://www.dopefly.com/] [http://hi.im/nathanstrutz] On Wed, Dec 22, 2010 at 7:23 AM, Mark A. Kruger mkru...@cfwebtools.comwrote: Ok regex gurus. here's what I have. I'm using IsapiRewrite (Helicon) on an IIS server. I have links like the following: http://domain/model/parts/subcat1/subcat2/subcat3/subcat4/subcat5 From 1 to 6 levels of sub categories. My rule finds parts and the model .. So I need a rule that gives me the rest of the url (everything after /parts/) and directs it to my controller - which figures out what to display. Here's what I have that works for the first level.. RewriteRule ^([^/]*)/parts(/)?$ /controllerScript.cfm?prodtype=productdisplayaction=displayProductCategorie smodel=$1 [L,QSA] So what do I need to work with subsequent levels. I'm trying to add something to the end of /parts(/)?$ . like (/*) or (/)*? . something that variablizes the rest of the URL .but I'm falling flat. Any rewrite gurus out there know what I'm doing wrong? Will I need a rule for each possible level maybe? -mark Mark A. Kruger, MCSE, CFG (402) 408-3733 ext 105 Skype: markakruger http://www.cfwebtools.com www.cfwebtools.com http://www.coldfusionmuse.com www.coldfusionmuse.com http://www.necfug.com/ www.necfug.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340203 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: More rewrite rule fun
Nate ok... what's the \w/ for? I'm not seeing that in my list of stuff I can use in the docs. Mark A. Kruger, MCSE, CFG (402) 408-3733 ext 105 Skype: markakruger www.cfwebtools.com www.coldfusionmuse.com www.necfug.com -Original Message- From: Nathan Strutz [mailto:str...@gmail.com] Sent: Wednesday, December 22, 2010 8:53 AM To: cf-talk Subject: Re: More rewrite rule fun Mark, If your regex ^([^/]*)/parts(/)?$ captures anything after the parts/, you have a bad regex engine. You probably want something like this: ^.*/parts/([\w/]+)$ Using the same replace pattern, you will end up with /controllerScript.cfm?prodtype=productdisplayaction=displayProductCategorie smodel=subcategory1/subcategory2/subcat3 Not sure if that's what you're going for, but a bad response is better than no response from the list ;) nathan strutz [http://www.dopefly.com/] [http://hi.im/nathanstrutz] On Wed, Dec 22, 2010 at 7:23 AM, Mark A. Kruger mkru...@cfwebtools.comwrote: Ok regex gurus. here's what I have. I'm using IsapiRewrite (Helicon) on an IIS server. I have links like the following: http://domain/model/parts/subcat1/subcat2/subcat3/subcat4/subcat5 From 1 to 6 levels of sub categories. My rule finds parts and the model .. So I need a rule that gives me the rest of the url (everything after /parts/) and directs it to my controller - which figures out what to display. Here's what I have that works for the first level.. RewriteRule ^([^/]*)/parts(/)?$ /controllerScript.cfm?prodtype=productdisplayaction=displayProductCategorie smodel=$1 [L,QSA] So what do I need to work with subsequent levels. I'm trying to add something to the end of /parts(/)?$ . like (/*) or (/)*? . something that variablizes the rest of the URL .but I'm falling flat. Any rewrite gurus out there know what I'm doing wrong? Will I need a rule for each possible level maybe? -mark Mark A. Kruger, MCSE, CFG (402) 408-3733 ext 105 Skype: markakruger http://www.cfwebtools.com www.cfwebtools.com http://www.coldfusionmuse.com www.coldfusionmuse.com http://www.necfug.com/ www.necfug.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340204 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: More rewrite rule fun
Nate... that worked I think... here's what I got.. [domain][***] (2) rewrite 'camaro/parts/brakes/pads/' - '/controllerscript.cfm? type=productaction=displayProductCategoriesmodel=camarosubcatpath=brakes/ pads/ I think that will work great... I just have to unpack the path and I'm good eh? Mark A. Kruger, MCSE, CFG (402) 408-3733 ext 105 Skype: markakruger www.cfwebtools.com www.coldfusionmuse.com www.necfug.com -Original Message- From: Nathan Strutz [mailto:str...@gmail.com] Sent: Wednesday, December 22, 2010 8:53 AM To: cf-talk Subject: Re: More rewrite rule fun Mark, If your regex ^([^/]*)/parts(/)?$ captures anything after the parts/, you have a bad regex engine. You probably want something like this: ^.*/parts/([\w/]+)$ Using the same replace pattern, you will end up with /controllerScript.cfm?prodtype=productdisplayaction=displayProductCategorie smodel=subcategory1/subcategory2/subcat3 Not sure if that's what you're going for, but a bad response is better than no response from the list ;) nathan strutz [http://www.dopefly.com/] [http://hi.im/nathanstrutz] On Wed, Dec 22, 2010 at 7:23 AM, Mark A. Kruger mkru...@cfwebtools.comwrote: Ok regex gurus. here's what I have. I'm using IsapiRewrite (Helicon) on an IIS server. I have links like the following: http://domain/model/parts/subcat1/subcat2/subcat3/subcat4/subcat5 From 1 to 6 levels of sub categories. My rule finds parts and the model .. So I need a rule that gives me the rest of the url (everything after /parts/) and directs it to my controller - which figures out what to display. Here's what I have that works for the first level.. RewriteRule ^([^/]*)/parts(/)?$ /controllerScript.cfm?prodtype=productdisplayaction=displayProductCategorie smodel=$1 [L,QSA] So what do I need to work with subsequent levels. I'm trying to add something to the end of /parts(/)?$ . like (/*) or (/)*? . something that variablizes the rest of the URL .but I'm falling flat. Any rewrite gurus out there know what I'm doing wrong? Will I need a rule for each possible level maybe? -mark Mark A. Kruger, MCSE, CFG (402) 408-3733 ext 105 Skype: markakruger http://www.cfwebtools.com www.cfwebtools.com http://www.coldfusionmuse.com www.coldfusionmuse.com http://www.necfug.com/ www.necfug.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340205 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: More rewrite rule fun
The \w typically means match any word. I think it's allowed in mod_rewrite rules. So this rule says look for /part/ and any word ending in / and find 1 or more of those words ending in / Nate, is that right? Wil Genovese Sr. Web Application Developer/ Systems Administrator 651-894-4238 wilg...@trunkful.com www.trunkful.com On Dec 22, 2010, at 8:57 AM, Mark A. Kruger wrote: Nate ok... what's the \w/ for? I'm not seeing that in my list of stuff I can use in the docs. Mark A. Kruger, MCSE, CFG (402) 408-3733 ext 105 Skype: markakruger www.cfwebtools.com www.coldfusionmuse.com www.necfug.com -Original Message- From: Nathan Strutz [mailto:str...@gmail.com] Sent: Wednesday, December 22, 2010 8:53 AM To: cf-talk Subject: Re: More rewrite rule fun Mark, If your regex ^([^/]*)/parts(/)?$ captures anything after the parts/, you have a bad regex engine. You probably want something like this: ^.*/parts/([\w/]+)$ Using the same replace pattern, you will end up with /controllerScript.cfm?prodtype=productdisplayaction=displayProductCategorie smodel=subcategory1/subcategory2/subcat3 Not sure if that's what you're going for, but a bad response is better than no response from the list ;) nathan strutz [http://www.dopefly.com/] [http://hi.im/nathanstrutz] On Wed, Dec 22, 2010 at 7:23 AM, Mark A. Kruger mkru...@cfwebtools.comwrote: Ok regex gurus. here's what I have. I'm using IsapiRewrite (Helicon) on an IIS server. I have links like the following: http://domain/model/parts/subcat1/subcat2/subcat3/subcat4/subcat5 From 1 to 6 levels of sub categories. My rule finds parts and the model .. So I need a rule that gives me the rest of the url (everything after /parts/) and directs it to my controller - which figures out what to display. Here's what I have that works for the first level.. RewriteRule ^([^/]*)/parts(/)?$ /controllerScript.cfm?prodtype=productdisplayaction=displayProductCategorie smodel=$1 [L,QSA] So what do I need to work with subsequent levels. I'm trying to add something to the end of /parts(/)?$ . like (/*) or (/)*? . something that variablizes the rest of the URL .but I'm falling flat. Any rewrite gurus out there know what I'm doing wrong? Will I need a rule for each possible level maybe? -mark Mark A. Kruger, MCSE, CFG (402) 408-3733 ext 105 Skype: markakruger http://www.cfwebtools.com www.cfwebtools.com http://www.coldfusionmuse.com www.coldfusionmuse.com http://www.necfug.com/ www.necfug.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340206 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: More rewrite rule fun
Excellent... thanks Wil. Mark A. Kruger, MCSE, CFG (402) 408-3733 ext 105 Skype: markakruger www.cfwebtools.com www.coldfusionmuse.com www.necfug.com -Original Message- From: Wil Genovese [mailto:jugg...@trunkful.com] Sent: Wednesday, December 22, 2010 9:11 AM To: cf-talk Subject: Re: More rewrite rule fun The \w typically means match any word. I think it's allowed in mod_rewrite rules. So this rule says look for /part/ and any word ending in / and find 1 or more of those words ending in / Nate, is that right? Wil Genovese Sr. Web Application Developer/ Systems Administrator 651-894-4238 wilg...@trunkful.com www.trunkful.com nsubscribe.cfm ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340207 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: More rewrite rule fun
Will, that's right. The \w switch is roughly equivalent to [A-Za-z0-9_], aka, letters, numbers and underscores. I put \w/ in there to capture the \w words and / forward slashes. This regex just captures any words slashes after /parts/, which is pretty good because it makes the ending slash optional. If you have other characters in your subcategories (like dashes), you can just add those to the [\w/] char group. You could get fancier, and capture the subcategories individually, but it gets trickier, and making that replacement in CF is so much easier. nathan strutz [http://www.dopefly.com/] [http://hi.im/nathanstrutz] On Wed, Dec 22, 2010 at 8:10 AM, Wil Genovese jugg...@trunkful.com wrote: The \w typically means match any word. I think it's allowed in mod_rewrite rules. So this rule says look for /part/ and any word ending in / and find 1 or more of those words ending in / Nate, is that right? Wil Genovese Sr. Web Application Developer/ Systems Administrator 651-894-4238 wilg...@trunkful.com www.trunkful.com On Dec 22, 2010, at 8:57 AM, Mark A. Kruger wrote: Nate ok... what's the \w/ for? I'm not seeing that in my list of stuff I can use in the docs. Mark A. Kruger, MCSE, CFG (402) 408-3733 ext 105 Skype: markakruger www.cfwebtools.com www.coldfusionmuse.com www.necfug.com -Original Message- From: Nathan Strutz [mailto:str...@gmail.com] Sent: Wednesday, December 22, 2010 8:53 AM To: cf-talk Subject: Re: More rewrite rule fun Mark, If your regex ^([^/]*)/parts(/)?$ captures anything after the parts/, you have a bad regex engine. You probably want something like this: ^.*/parts/([\w/]+)$ Using the same replace pattern, you will end up with /controllerScript.cfm?prodtype=productdisplayaction=displayProductCategorie smodel=subcategory1/subcategory2/subcat3 Not sure if that's what you're going for, but a bad response is better than no response from the list ;) nathan strutz [http://www.dopefly.com/] [http://hi.im/nathanstrutz] On Wed, Dec 22, 2010 at 7:23 AM, Mark A. Kruger mkru...@cfwebtools.comwrote: Ok regex gurus. here's what I have. I'm using IsapiRewrite (Helicon) on an IIS server. I have links like the following: http://domain/model/parts/subcat1/subcat2/subcat3/subcat4/subcat5 From 1 to 6 levels of sub categories. My rule finds parts and the model .. So I need a rule that gives me the rest of the url (everything after /parts/) and directs it to my controller - which figures out what to display. Here's what I have that works for the first level.. RewriteRule ^([^/]*)/parts(/)?$ /controllerScript.cfm?prodtype=productdisplayaction=displayProductCategorie smodel=$1 [L,QSA] So what do I need to work with subsequent levels. I'm trying to add something to the end of /parts(/)?$ . like (/*) or (/)*? . something that variablizes the rest of the URL .but I'm falling flat. Any rewrite gurus out there know what I'm doing wrong? Will I need a rule for each possible level maybe? -mark Mark A. Kruger, MCSE, CFG (402) 408-3733 ext 105 Skype: markakruger http://www.cfwebtools.com www.cfwebtools.com http://www.coldfusionmuse.com www.coldfusionmuse.com http://www.necfug.com/ www.necfug.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340208 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: More rewrite rule fun
Thanks Nate - I have to add '-' and account for ''. Wil Genovese Sr. Web Application Developer/ Systems Administrator wilg...@trunkful.com www.trunkful.com On Dec 22, 2010, at 10:41 AM, Nathan Strutz wrote: Will, that's right. The \w switch is roughly equivalent to [A-Za-z0-9_], aka, letters, numbers and underscores. I put \w/ in there to capture the \w words and / forward slashes. This regex just captures any words slashes after /parts/, which is pretty good because it makes the ending slash optional. If you have other characters in your subcategories (like dashes), you can just add those to the [\w/] char group. You could get fancier, and capture the subcategories individually, but it gets trickier, and making that replacement in CF is so much easier. nathan strutz [http://www.dopefly.com/] [http://hi.im/nathanstrutz] On Wed, Dec 22, 2010 at 8:10 AM, Wil Genovese jugg...@trunkful.com wrote: The \w typically means match any word. I think it's allowed in mod_rewrite rules. So this rule says look for /part/ and any word ending in / and find 1 or more of those words ending in / Nate, is that right? Wil Genovese Sr. Web Application Developer/ Systems Administrator 651-894-4238 wilg...@trunkful.com www.trunkful.com On Dec 22, 2010, at 8:57 AM, Mark A. Kruger wrote: Nate ok... what's the \w/ for? I'm not seeing that in my list of stuff I can use in the docs. Mark A. Kruger, MCSE, CFG (402) 408-3733 ext 105 Skype: markakruger www.cfwebtools.com www.coldfusionmuse.com www.necfug.com -Original Message- From: Nathan Strutz [mailto:str...@gmail.com] Sent: Wednesday, December 22, 2010 8:53 AM To: cf-talk Subject: Re: More rewrite rule fun Mark, If your regex ^([^/]*)/parts(/)?$ captures anything after the parts/, you have a bad regex engine. You probably want something like this: ^.*/parts/([\w/]+)$ Using the same replace pattern, you will end up with /controllerScript.cfm?prodtype=productdisplayaction=displayProductCategorie smodel=subcategory1/subcategory2/subcat3 Not sure if that's what you're going for, but a bad response is better than no response from the list ;) nathan strutz [http://www.dopefly.com/] [http://hi.im/nathanstrutz] On Wed, Dec 22, 2010 at 7:23 AM, Mark A. Kruger mkru...@cfwebtools.comwrote: Ok regex gurus. here's what I have. I'm using IsapiRewrite (Helicon) on an IIS server. I have links like the following: http://domain/model/parts/subcat1/subcat2/subcat3/subcat4/subcat5 From 1 to 6 levels of sub categories. My rule finds parts and the model .. So I need a rule that gives me the rest of the url (everything after /parts/) and directs it to my controller - which figures out what to display. Here's what I have that works for the first level.. RewriteRule ^([^/]*)/parts(/)?$ /controllerScript.cfm?prodtype=productdisplayaction=displayProductCategorie smodel=$1 [L,QSA] So what do I need to work with subsequent levels. I'm trying to add something to the end of /parts(/)?$ . like (/*) or (/)*? . something that variablizes the rest of the URL .but I'm falling flat. Any rewrite gurus out there know what I'm doing wrong? Will I need a rule for each possible level maybe? -mark Mark A. Kruger, MCSE, CFG (402) 408-3733 ext 105 Skype: markakruger http://www.cfwebtools.com www.cfwebtools.com http://www.coldfusionmuse.com www.coldfusionmuse.com http://www.necfug.com/ www.necfug.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340209 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Internationalization of Week() function in CF - Last resort to Java [spamtrap heur]
On 12/22/2010 8:41 PM, Nando wrote: numbers are often used in calenders and agendas. A question such as Can we arrange a meeting during week 43? can be rather common. The question, for actually i think that's rather an uncommon datepart to use. in fact in all my years nobody's ever asked for that functionality. furthermore the ISO calendar is not universal, it won't work in the US/Canada in most arabic countries for instance. week starts are *locale* based. but anyways, see below. Long story short, I eventually solved this, as a last resort, by dropping down to Java. I'm an absolute novice at Java and wanted to ask if anyone java is not an uncommon solution to i18n problems in cf. you can short circuit this var inputDate = DateFormat(inputDateObj,-mm-dd); var formatter = CreateObject(java,java.text.SimpleDateFormat).init(-MM-dd); var theDate = formatter.parse(inputDate); to this: cfscript function ISOWeek(inputDateObj) { c = CreateObject(java,java.util.Calendar).getInstance(); c.setTimeInMillis(arguments.inputDateObj.getTime()); c.setFirstDayOfWeek(c.MONDAY); c.setMinimalDaysInFirstWeek(4); return c.get(c.WEEK_OF_YEAR); } /cfscript bit of advice, rather than do it this way you might want to think about simply supplying timezone and locale arguments to the calendar getInstance() method. see this snippet: cfscript locales=createObject(java,java.util.Locale).getAvailableLocales(); calObj=createObject(java,java.util.Calendar); for (i=1; i LTE arrayLen(locales); i=i+1) { cal=calObj.getInstance(locales[i]); writeoutput(#locales[i].getDisplayName()# (#locales[i].toString()#) 1st day of week:=#cal.getFirstDayOfWeek()#br); } /cfscript supplying a user's locale will ensure you get their week numbers correct without having to resort to universalities that aren't. final bit of advice, if you want to get the best/latest locale data, use the icu4j lib instead of core java. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340210 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Trapping entityDelete() errors
Working with ColdFusion 9 ORM, is there a way to trap entityDelete() errors when there's a constraint violation. I have my delete setup like so: try { entityDelete(local.objSongCategory); // report success } catch (Any e) { transaction action=rollback; // report fail } However, if I attempt to delete a record in use (a song assigned to category being deleted), CF throws an error: coldfusion.orm.hibernate.HibernateSessionException: Cannot delete or update a parent row: a foreign key constraint fails (`databasename`.`songs`, CONSTRAINT `songs_ibfk_3` FOREIGN KEY (`SongCategoryID`) REFERENCES `songcategories` (`SongCategoryID`)). (Database) I'm a little puzzled why the error isn't being caught since the delete is occurring inside a try/catch. Any thoughts? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340211 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Webservice error after CF 8.01 update
Hi Mack, Just wondering if you filed this as a bug. My webservice continually throws the duplicate class error message after running for some time. I have resorted now to running the following code every 1 hour to clear the template cache and hopefully avoid this error: !--- login --- cftry cfinvoke component=cfide.adminapi.administrator method=login adminPassword= adminUsername=admin cflog file=wsCACHE text=Log in successful cfcatch cflog file=wsCACHE text=Error logging in to CFADMIN. #cfcatch.message# cfabort /cfcatch /cftry !--- release templates from template cache --- cfset filepath = 'C:\Inetpub\wwwroot\www.yourmamassofat.com\cmp\bridge\' cfset tpllist = '' cfset tpllist = listAppend(tpllist, filepath 'cp_startup.cfc') cfset tpllist = listAppend(tpllist, filepath 'cp_register.cfc') cfset tpllist = listAppend(tpllist, filepath 'cp_createTask.cfc') cfset tpllist = listAppend(tpllist, filepath 'cp_deleteTask.cfc') cfset tpllist = listAppend(tpllist, filepath 'cp_getFieldList.cfc') cfset tpllist = listAppend(tpllist, filepath 'cp_getFieldListandfilters.cfc') cfset tpllist = listAppend(tpllist, filepath 'cp_uninstallBridge.cfc') cfset tpllist = listAppend(tpllist, filepath 'cp_updateTask.cfc') cfset tpllist = listAppend(tpllist, filepath 'bridge.cfc') cftry cfinvoke component=cfide.adminapi.runtime method=clearTrustedCache templateList=#tpllist# !--- log failure clearing template cache --- cfcatch cflog file=wsCACHE text=Errror clearing template cache via adminAPI. #cfcatch.message# /cfcatch /cftry !--- log success --- cflog file=wsCACHE text=Template Cache cleared !--- logout --- cftry cfinvoke component=cfide.adminapi.administrator method=logout adminPassword= adminUsername=admin templateList=#tpllist# cfcatch cflog file=wsCACHE text=Error logging out of CFADMIN /cfcatch /cftry Brook -Original Message- From: Mack [mailto:mrsmith.w...@gmail.com] Sent: December-11-10 10:05 AM To: cf-talk Subject: Re: Webservice error after CF 8.01 update Grrr I've pretty much exhausted all my options now, this is driving me batty.. Brook, I think this is a bug in CF. I've made a small testcase on which I can reproduce the error all the time: http://dl.dropbox.com/u/15688335/wstest.zip 1. Put the files in a wstest folder in your root. 2. create a file to test the web service : cfset ws = createObject(webservice, http://SERVER/wstest/ws.cfc?wsdl;).function1() 3. run the test file once. It should work properly. 4. rename wstest/result/function1Response.cfc (adding 1 at the end of the file works just fine) 5. run the test file. It should complain about function1Response.cfc not being found. 6. rename the cfc back to function1Response.cfc 7. run the test file. On my server (9.0.1) it alternates between 'java.lang.LinkageError : loader (instance of coldfusion/xml/rpc/SkeletonClassLoader): attempted duplicate class definition for name: wstest/result/Function1Response' and 'java.lang.ClassNotFoundException : wstest.result.Function1Response][java.lang.NullPointerException : null' The error is cleared temporarily by: - changing ws.cfc (adding spaces at the start for example); - using the clearTrustedCache function like in your code. If you can duplicate the error I will log this as a bug with Adobe. -- Mack ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340212 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
CF 8.01 Services freezing up
I have seen where others have posted this question, but no resolution. CF keeps restarting and sometimes will lock up so badly that i have to restart the server? Here is the error message: The description for Event ID 0 from source ColdFusion 8 ODBC Server cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer. If the event originated on another computer, the display information had to be saved with the event. The following information was included with the event: ColdFusion 8 ODBC ser...@localhost,ErrorCode=2310,ErrorMessage=TCP/IP, connection reset by peer I am running CF 8.01 on Windows Server 2008 using IIS 7. Merry Christmas ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340213 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CF 8.01 Services freezing up
I have seen where others have posted this question, but no resolution. CF keeps restarting and sometimes will lock up so badly that i have to restart the server? Here is the error message: The description for Event ID 0 from source ColdFusion 8 ODBC Server cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer. If the event originated on another computer, the display information had to be saved with the event. The following information was included with the event: ColdFusion 8 ODBC ser...@localhost,ErrorCode=2310,ErrorMessage=TCP/IP, connection reset by peer I am running CF 8.01 on Windows Server 2008 using IIS 7. What databases are you using? If you're not using ODBC datasources, you can simply disable the ODBC services installed by CF. In any case, it's not clear that this is actually the cause of (or even related to) your problem. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340214 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CF 8.01 Services freezing up
I am using MS Access and assigning the Datasource using CF Administrator as MS Access with Unicode. Does that help? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340215 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CF 8.01 Services freezing up
I am using MS Access and assigning the Datasource using CF Administrator as MS Access with Unicode. Does that help? The MS Access with Unicode driver doesn't use ODBC. So, you can disable the ODBC services and see if that fixes your problem. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340216 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CF 8.01 Services freezing up
The MS Access with Unicode driver doesn't use ODBC. So, you can disable the ODBC services and see if that fixes your problem. I am using 2 websites with SQL Server Express. If I stop this, will it affect those. And what is the ODBC Services for if not to manage database connections? In what situation would I use the ODBC Services? Thanks for your help! ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340217 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CF 8.01 Services freezing up
I am using 2 websites with SQL Server Express. If I stop this, will it affect those. No. And what is the ODBC Services for if not to manage database connections? In what situation would I use the ODBC Services? The ODBC services act as a bridge from your JDBC client (CF) to databases that support ODBC but don't also have JDBC drivers. CF uses JDBC to connect to SQL Server, Oracle, etc. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340218 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: CF 8.01 Services freezing up
The ODBC service is really only used by people with MSACCESS DSN's, it you don't have any of these, and are not using the ODBC bridge, then your not using the ODBC service. Russ -Original Message- From: David Moore [mailto:dgmoor...@hotmail.com] Sent: 22 December 2010 21:31 To: cf-talk Subject: Re: CF 8.01 Services freezing up The MS Access with Unicode driver doesn't use ODBC. So, you can disable the ODBC services and see if that fixes your problem. I am using 2 websites with SQL Server Express. If I stop this, will it affect those. And what is the ODBC Services for if not to manage database connections? In what situation would I use the ODBC Services? Thanks for your help! ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340219 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CF 8.01 Services freezing up
Thank you Dan and Russ. You have been a tremendous help. I have turned the ODBC Service off and will report back if this resolves the issue so others may benefit from this post. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340220 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CF 8.01 Services freezing up
If you have checked Maintain connections across client requests, stopping ColdFusion 8 ODBC Server shuts down the websites? I had some sites stop working while others didn't. After investigating their datasource settings, this is what I found. So, do you recommend removing the selection for all websites and turning off ODBC Server? David Moore UpstateWeb, LLC ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340221 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: CF 8.01 Services freezing up
They must have been ODBC data sources then, a JDBC Data source uses JDBC and not ODBC. Russ -Original Message- From: David Moore [mailto:dgmoor...@hotmail.com] Sent: 22 December 2010 22:22 To: cf-talk Subject: Re: CF 8.01 Services freezing up If you have checked Maintain connections across client requests, stopping ColdFusion 8 ODBC Server shuts down the websites? I had some sites stop working while others didn't. After investigating their datasource settings, this is what I found. So, do you recommend removing the selection for all websites and turning off ODBC Server? David Moore UpstateWeb, LLC ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340222 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CF 8.01 Services freezing up
They must have been ODBC data sources then, a JDBC Data source uses JDBC and not ODBC. I guess then, what you are telling me, is I should be using a JDBC Data source. Any place to get directions on how to do this? David ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340223 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: CF 8.01 Services freezing up
As has been mentioned already the MSACCESS with Unicode DSN does not use JDBC, so you can use that instead for your Access DSN's Russ From: David Moore [mailto:dgmoor...@hotmail.com] Sent: 22 December 2010 22:56 To: cf-talk Subject: Re: CF 8.01 Services freezing up They must have been ODBC data sources then, a JDBC Data source uses JDBC and not ODBC. I guess then, what you are telling me, is I should be using a JDBC Data source. Any place to get directions on how to do this? David ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340224 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Care to Beta test new ColdFusion Exception Manager App?
I just posted Kakapo: Enhanced ColdFusion Exception/error Manager App. Care to Beta test anyone? http://cflove.org/2010/11/coldfusion-error-handler.cfm ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340225 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CF 8.01 Services freezing up
If you have checked Maintain connections across client requests, stopping ColdFusion 8 ODBC Server shuts down the websites? I had some sites stop working while others didn't. After investigating their datasource settings, this is what I found. Are you sure you're not using any ODBC data sources? Maybe it would be a good idea to list explicitly what database drivers you're using for each data source. So, do you recommend removing the selection for all websites and turning off ODBC Server? I would generally not recommend unchecking that option in production, as it'll make things slower and less efficient. But if shutting it off keeps your server from crashing, go ahead and shut it off. I'd recommend turning off the two ODBC services if you're not using them. But make sure you're not using them. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340226 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Internationalization of Week() function in CF - Last resort to Java
Thanks for sharing. -Original Message- From: Nando [mailto:d.na...@gmail.com] Sent: Wednesday, December 22, 2010 7:42 AM To: cf-talk Subject: Internationalization of Week() function in CF - Last resort to Java I'm developing a scheduling application in CF. While doing so, I've discovered that there are a variety of different methods for determining the week number, and that depending on the locale, a week can begin on Saturday, Sunday or Monday. The first week of the year can be determined in a variety of ways, and can be numbered in a variety of ways, such that January 1 of a given year might be in week 0, 1, 52 or 53. Complicating this somewhat is that there is no clear indication which standard CF's inbuilt Week() function follows. All this might not seem so important to Americans, but here in Europe, week numbers are often used in calenders and agendas. A question such as Can we arrange a meeting during week 43? can be rather common. The question, for me, was What standard is followed in Europe to determine week numbers. The closest thing I found to a universal standard is the ISO week date system, and I decided that's good enough for me. Reading the technical definition makes it sound pretty complex, but it can be reduced to weeks start on monday and the first week of the year is the first week with work days in it, which effectively means the week that contains January 4. There's a ISOWeek function on cflib that tries, but fails to generate the correct ISO week number some years. Long story short, I eventually solved this, as a last resort, by dropping down to Java. I'm an absolute novice at Java and wanted to ask if anyone could improve on the UDF I came up with before I submit it to CFLib ... cfscript function ISOWeek(inputDateObj) { var inputDate = DateFormat(inputDateObj,-mm-dd); var formatter = CreateObject(java,java.text.SimpleDateFormat).init(-MM-dd); var theDate = formatter.parse(inputDate); c = CreateObject(java,java.util.Calendar).getInstance(); c.setTimeInMillis(theDate.getTime()); c.setFirstDayOfWeek(c.MONDAY); c.setMinimalDaysInFirstWeek(4); return c.get(c.WEEK_OF_YEAR); } /cfscript ... using the following references and a good measure of fumbling around. http://www.jarvana.com/jarvana/view/com/h2database/h2/1.2.128/h2-1.2.128-sou rces.jar!/org/h2/util/DateTimeIso8601Utils.java?format=ok http://www.java2s.com/Tutorial/Java/0040__Data-Type/CreateajavautilDateObjec tfromaYearMonthDayFormat.htm http://www.coldfusionmuse.com/index.cfm/2009/2/23/Unpacking-Java-In-Coldfusi on I also want to suggest that Week() is internationalized appropriately in CF as an enhancement request. Thanks, Nando -- Nando M. Breiter Aria Media CP 234 6934 Bioggio Switzerland +41 91 606 6372 www.aria-media.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340227 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CF 8.01 Services freezing up
In CFAdmin, if I go into SERVER SETTINGS Settings Summary, in the Database Data Sources section, it lists all my data sources. So, if I see everything using a JDBC URL, does that mean that I don't use ODBC data sources? On 12/22/2010 3:51 PM, Dave Watts wrote: If you have checked Maintain connections across client requests, stopping ColdFusion 8 ODBC Server shuts down the websites? I had some sites stop working while others didn't. After investigating their datasource settings, this is what I found. Are you sure you're not using any ODBC data sources? Maybe it would be a good idea to list explicitly what database drivers you're using for each data source. So, do you recommend removing the selection for all websites and turning off ODBC Server? I would generally not recommend unchecking that option in production, as it'll make things slower and less efficient. But if shutting it off keeps your server from crashing, go ahead and shut it off. I'd recommend turning off the two ODBC services if you're not using them. But make sure you're not using them. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340228 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CF 8.01 Services freezing up
In CFAdmin, if I go into SERVER SETTINGS Settings Summary, in the Database Data Sources section, it lists all my data sources. So, if I see everything using a JDBC URL, does that mean that I don't use ODBC data sources? I'm not in front of a machine running CF, so I'm not sure exactly what shows up in there. Even when you're using ODBC, though, you're still using JDBC, as that's all that CF knows (being a Java application). Java applications only use JDBC. The ODBC Server and ODBC Agent services act as a JDBC-to-ODBC bridge. So, my guess would be that you'll see all your data sources as having JDBC URLs no matter what, but that the ones that use the ODBC services will mention sequelink or something along those lines. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340229 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: CF 8.01 Services freezing up
No... when you are using odbc you are still using a JDBC Bridge driver. In the case of CF it's from sequelink and you can see it running in the task list as swsoc.exe it's what get's fired off with the Coldfusion ODBC Service. Whats really happening under the hood is that a JDBC driver is connecting to a socket provided by sequelink's service and issue JDBC commands. Sequelink translates these commands or calls into ODBC Calls and connects to the datasource the Access file using ODBC. It get's the results and translates them back into JDBC and sends them up the chain to the JDBC bridge driver So even though you are ODBC'ing the datasource you are still using JDBC and bridging to it. This is one of the reasons why Access became a much worse idea as soon as CF moved to Java. Instead of using the ODBC subsystem directly it now requires an intermediate layer to connect. -Mark Mark A. Kruger, MCSE, CFG (402) 408-3733 ext 105 Skype: markakruger www.cfwebtools.com www.coldfusionmuse.com www.necfug.com -Original Message- From: rex [mailto:li...@pgrworld.com] Sent: Wednesday, December 22, 2010 6:11 PM To: cf-talk Subject: Re: CF 8.01 Services freezing up In CFAdmin, if I go into SERVER SETTINGS Settings Summary, in the Database Data Sources section, it lists all my data sources. So, if I see everything using a JDBC URL, does that mean that I don't use ODBC data sources? On 12/22/2010 3:51 PM, Dave Watts wrote: If you have checked Maintain connections across client requests, stopping ColdFusion 8 ODBC Server shuts down the websites? I had some sites stop working while others didn't. After investigating their datasource settings, this is what I found. Are you sure you're not using any ODBC data sources? Maybe it would be a good idea to list explicitly what database drivers you're using for each data source. So, do you recommend removing the selection for all websites and turning off ODBC Server? I would generally not recommend unchecking that option in production, as it'll make things slower and less efficient. But if shutting it off keeps your server from crashing, go ahead and shut it off. I'd recommend turning off the two ODBC services if you're not using them. But make sure you're not using them. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340230 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CF 8.01 Services freezing up
In CFAdmin, if I go into SERVER SETTINGS Settings Summary, in the Database Data Sources section, it lists all my data sources. So, if I see everything using a JDBC URL, does that mean that I don't use ODBC data sources? All of mine look like the following: JDBC URL jdbc:izmado:Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\\Inetpub\\wwwroot\\domain\\mydatabases\\database.mdb;Izm JdbcEsc=yes;IzmReleaseOnClose= no I'm not in front of a machine running CF, so I'm not sure exactly what shows up in there. Even when you're using ODBC, though, you're still using JDBC, as that's all that CF knows (being a Java application). Java applications only use JDBC. The ODBC Server and ODBC Agent services act as a JDBC-to-ODBC bridge. So, my guess would be that you'll see all your data sources as having JDBC URLs no matter what, but that the ones that use the ODBC services will mention sequelink or something along those lines. Does this help Dan? I am pretty sure I am using ODBC. I set up all my Datasources using the drop down list in CF Admin. I am guessing I should do this another way? I have just never figured out how to do it. David Moore UpstateWeb, LLC ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340231 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CF 8.01 Services freezing up
All of mine look like the following: JDBC URL jdbc:izmado:Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\\Inetpub\\wwwroot\\domain\\mydatabases\\database.mdb;Izm JdbcEsc=yes;IzmReleaseOnClose= no Those are using the Access with Unicode driver, which isn't an ODBC driver. It's a JDBC-to-JET driver. It doesn't rely on the ODBC services. Does this help Dan? I am pretty sure I am using ODBC. I set up all my Datasources using the drop down list in CF Admin. You're using ODBC if: - you chose the Microsoft Access driver (not the MS Access with Unicode driver), or - you chose ODBC Socket. I am guessing I should do this another way? I have just never figured out how to do it. No, that's how you're supposed to create data sources. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340232 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CF 8.01 Services freezing up
Those are using the Access with Unicode driver, which isn't an ODBC driver. It's a JDBC-to-JET driver. It doesn't rely on the ODBC services. Then that is what I am doing, but as I stated earlier, if I have the Maintain connections checked and stop Coldfusion 8 ODBC Server, the websites stop working. Any suggestions from this, other than the obvious as Mark Kruger has told me many times stop using Access. David Moore UpstateWeb, LLC ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340233 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: CF 8.01 Services freezing up
David, Stopping these services should not stop your websites working, at worst it would result in database errors on those sites saying they were unable to connect to the database, but if the website completely stops working then there is some other issue at work here. What EXACTLY happens to the site, what is the message you get in your browser. Russ -Original Message- From: David Moore [mailto:dgmoor...@hotmail.com] Sent: 23 December 2010 00:34 To: cf-talk Subject: Re: CF 8.01 Services freezing up Those are using the Access with Unicode driver, which isn't an ODBC driver. It's a JDBC-to-JET driver. It doesn't rely on the ODBC services. Then that is what I am doing, but as I stated earlier, if I have the Maintain connections checked and stop Coldfusion 8 ODBC Server, the websites stop working. Any suggestions from this, other than the obvious as Mark Kruger has told me many times stop using Access. David Moore UpstateWeb, LLC ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340234 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CF 8.01 Services freezing up
Stopping these services should not stop your websites working, at worst it would result in database errors on those sites saying they were unable to connect to the database, but if the website completely stops working then there is some other issue at work here. What EXACTLY happens to the site, what is the message you get in your browser. All but two of my website apps use Access with Unicode that I set up using the datasources interface in CF Admin. The websites that have maintain connections hang and timeout. Ones that don't have the maintain connections selected come right up. Sorry about repeating some information, I just want to make sure I am being clear. David Moore UpstateWeb, LLC ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340235 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CF 8.01 Services freezing up
Then that is what I am doing, but as I stated earlier, if I have the Maintain connections checked and stop Coldfusion 8 ODBC Server, the websites stop working. Any suggestions from this, other than the obvious as Mark Kruger has told me many times stop using Access. I suggest that you stop the ODBC services, restart CF and see what happens. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340236 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Internationalization of Week() function in CF - Last resort to Java [spamtrap heur]
On Wed, Dec 22, 2010 at 10:19 AM, Paul Hastings wrote: ... supplying a user's locale will ensure you get their week numbers correct without having to resort to universalities that aren't. +1! final bit of advice, if you want to get the best/latest locale data, use the icu4j lib instead of core java. Joda seems pretty swell too. :Den -- Those who wish to appear wise among fools, among the wise seem foolish. Marcus Fabius Quintilian ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340237 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Care to Beta test new ColdFusion Exception Manager App?
On Wed, Dec 22, 2010 at 3:57 PM, Saman Jayasekara wrote: I just posted Kakapo: Enhanced ColdFusion Exception/error Manager App. Care to Beta test anyone? http://cflove.org/2010/11/coldfusion-error-handler.cfm Seems nifty! No time to test ATM, but does it have a throttle, so you don't accidentally DoS yourself? :Den -- Though ambition in itself is a vice, yet it is often the parent of virtues. Marcus Fabius Quintilian ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340238 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Internationalization of Week() function in CF - Last resort to Java [spamtrap heur] [spamtrap bayes][spamtrap heur]
On 12/23/2010 11:19 AM, denstar wrote: Joda seems pretty swell too. always thought joda was kind of like swatting a fly w/a battleship specific to this case it don't know no steenking locales ;-) icu4j is almost always the best choice when it comes to i18n functionality. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340239 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Internationalization of Week() function in CF - Last resort to Java [spamtrap heur] [spamtrap bayes][spamtrap heur]
On Wed, Dec 22, 2010 at 10:26 PM, Paul Hastings wrote: On 12/23/2010 11:19 AM, denstar wrote: Joda seems pretty swell too. always thought joda was kind of like swatting a fly w/a battleship specific to this case it don't know no steenking locales ;-) Heh! =)p I am partial to battleships as fly killers. Giant, mutant flies, obviously. icu4j is almost always the best choice when it comes to i18n functionality. You deal with it a lot. I dabble, and went to a nifty presentation on Joda, so... works for me. =) :Den -- To swear, except when necessary, is becoming to an honorable man. Marcus Fabius Quintilian ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340240 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm