Re: [Macromedia][SequeLink JDBC Driver]Network problem, session aborted due to internal error in remote procedure call, connection closed

2009-12-16 Thread Gabriela Palombi

Hi. Did you solve this problem? Iam getting this error...CF 8 and Oracle 11.

 Hi
 
 I am getting the following error everytime i try to run the query 
 below from the coldfusion page.
 
 [Macromedia][SequeLink JDBC Driver]Network problem, session aborted 
 due to internal error in remote procedure call, connection closed. 
 
 cfquery name=offerreport datasource=#placement#
 SELECT job_info.org_name, job_info.Position, job_info.offer_id, 
 job_info.accepted_date, job_info.job_id,
 job_info.org_id, job_info.job_info_id, job_info.job_type, job_info.
 acceptance_status,
 offer_list.Offer_type, corporation.title
 FROM job_info, offer_list, corporation
 WHERE job_info.Student_ID = '#COOKIE.id#'
   AND job_info.offer_id *= offer_list.offer_id
   AND job_info.org_id *= corporation.org_id
 ORDER BY job_info.org_name, job_info.Position
 /cfquery
 
 The query is fine, it works if i directly run it in the MS SQL Query 
 Analyzer...
 
 While submitting the page which has this query, If i click on submit 
 several times, then in one of the clicks the query gives correct 
 results.
 
 Has anyone faced the same problem. If yes, did you get a resolution to 
 it?
 
 Thanks
Nimesh 

~|
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:329173
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Null Pointers are another name for undefined values

2009-12-16 Thread Steve Logan

I have a friend who came to me a while ago with a site that wanted to change
hosts and have a new look and feel.  He would handle the look and feel and
I'd take care of the backend.  Originally he wanted to rewrite from CF to
ASP, but I told him keep it CF and I can do it a lot faster and cheaper.
That sold him.  Unfortunately, his client pre-paid for 3 years of hosting at
Network Solutions and is insisting on using their Coldfusion hosting.  Even
though I used to work for a hosting company that has really good CF hosting,
cheaper than NSI, they're sold on the reliability of the big boys.  Ugh -
fine.  Convert existing db from MySQL to Access, convert all SQL to be
compatible, test locally and it works like a charm.  Upload a test
Application.cfc and index.cfm file to NSI (it took NSI 7 days to add a DSN
for me) and immediately get an error as follows:

 

The system has attempted to use an undefined value, which usually indicates
a programming error, either in your code or some system code.

Null Pointers are another name for undefined values. 

 

I've trimmed the Application.cfc file down to just:

 

cfcomponent

cfscript

  this.name = ihatenetworksolutions;

  this.applicationTimeout = createTimeSpan(1,0,0,0);

  this.sessionTimeout = createTimeSpan(0,0,20,0);

  this.sessionmanagement = yes;

  this.setClientCookies = yes;

  this.setDomainCookies = no;

/cfscript

  cffunction name=onApplicationStart returntype=boolean output=false

cfreturn this/

  /cffunction

  

  cffunction name=onApplicationEnd returntype=void output=false 

   cfargument name=applicationScope required=true 

  /cffunction  

/cfcomponent  

 

If I don't upload an index.cfm file, I get a Directory Listing Denied error.
As soon as I upload an index.cfm file - even just a hello world one, I get
that null pointer error.

 

I'm assuming their NSI's support will be useless if it took them a week to
set a DSN.

 

Some googling on this error took me to several forums where there error is
there, but there seems to be a just a lot of ideas as to the cause (broke
JVM), and no real concrete solutions.

 

 



~|
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:329174
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Null Pointers are another name for undefined values

2009-12-16 Thread Charlie Griefer

Can you upload just a hello world index.cfm without an Application.cfc (or
Application.cfm)?  Just curious as to whether or not the issue is definitely
in the Application.cfc.

On Wed, Dec 16, 2009 at 7:49 AM, Steve Logan st...@sagescholars.com wrote:


 I have a friend who came to me a while ago with a site that wanted to
 change
 hosts and have a new look and feel.  He would handle the look and feel
 and
 I'd take care of the backend.  Originally he wanted to rewrite from CF to
 ASP, but I told him keep it CF and I can do it a lot faster and cheaper.
 That sold him.  Unfortunately, his client pre-paid for 3 years of hosting
 at
 Network Solutions and is insisting on using their Coldfusion hosting.  Even
 though I used to work for a hosting company that has really good CF
 hosting,
 cheaper than NSI, they're sold on the reliability of the big boys.  Ugh -
 fine.  Convert existing db from MySQL to Access, convert all SQL to be
 compatible, test locally and it works like a charm.  Upload a test
 Application.cfc and index.cfm file to NSI (it took NSI 7 days to add a DSN
 for me) and immediately get an error as follows:



 The system has attempted to use an undefined value, which usually indicates
 a programming error, either in your code or some system code.

 Null Pointers are another name for undefined values.



 I've trimmed the Application.cfc file down to just:



 cfcomponent

 cfscript

  this.name = ihatenetworksolutions;

  this.applicationTimeout = createTimeSpan(1,0,0,0);

  this.sessionTimeout = createTimeSpan(0,0,20,0);

  this.sessionmanagement = yes;

  this.setClientCookies = yes;

  this.setDomainCookies = no;

 /cfscript

  cffunction name=onApplicationStart returntype=boolean output=false

cfreturn this/

  /cffunction



  cffunction name=onApplicationEnd returntype=void output=false

   cfargument name=applicationScope required=true

  /cffunction

 /cfcomponent



 If I don't upload an index.cfm file, I get a Directory Listing Denied
 error.
 As soon as I upload an index.cfm file - even just a hello world one, I
 get
 that null pointer error.



 I'm assuming their NSI's support will be useless if it took them a week to
 set a DSN.



 Some googling on this error took me to several forums where there error is
 there, but there seems to be a just a lot of ideas as to the cause (broke
 JVM), and no real concrete solutions.







 

~|
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:329175
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Null Pointers are another name for undefined values

2009-12-16 Thread Steve Logan

Yes - removing the application.cfc file and just putting up a simple index.cfm 
file works fine.

I have literally stripped everything out of the application.cfc file and except 
for onApplicationStart and onApplicationEnd.  I also changed the 
cfscriptthis.name=myapp/cfscript to cfset THIS.name = myapp/ and 
still getting that error.  

I've also loaded this application.cfc onto a CFMX7 server that I administer and 
it works fine there (development environment is CF8 as that's where I was 
anticipating hosting them until they insisted on NSI).

Can you upload just a hello world index.cfm without an Application.cfc (or
Application.cfm)?  Just curious as to whether or not the issue is definitely
in the Application.cfc.



~|
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:329176
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Null Pointers are another name for undefined values

2009-12-16 Thread Charlie Griefer

... and you're sure that the hosting environment is CF7?  does an
Application.cfm work?  can you dump the server scope to verify the CF
version?

On Wed, Dec 16, 2009 at 8:24 AM, Steve Logan st...@sagescholars.com wrote:


 Yes - removing the application.cfc file and just putting up a simple
 index.cfm file works fine.

 I have literally stripped everything out of the application.cfc file and
 except for onApplicationStart and onApplicationEnd.  I also changed the
 cfscriptthis.name=myapp/cfscript to cfset THIS.name = myapp/ and
 still getting that error.

 I've also loaded this application.cfc onto a CFMX7 server that I administer
 and it works fine there (development environment is CF8 as that's where I
 was anticipating hosting them until they insisted on NSI).

 Can you upload just a hello world index.cfm without an Application.cfc
 (or
 Application.cfm)?  Just curious as to whether or not the issue is
 definitely
 in the Application.cfc.
 


 

~|
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:329177
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: CF5 Site-wide Error Handler

2009-12-16 Thread Donnie Carvajal

I wanted to repost this.  See below.  Any help is appreciated.

 I have a site-wide error handler setup for a CF 5 server.  I also have 
 one setup for an MX7 server.  The MX7 server will still display the 
 standard debug information even if the site-wide error handler is 
 triggered.  The CF 5 server will not.  Is this a limitation with CF 5 
 or am I missing a setting?
 
 Thanks,
 Donnie 


~|
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:329178
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Null Pointers are another name for undefined values

2009-12-16 Thread Steve Logan

Application.cfm DOES work.

Appserver:  JRun4
ProductLevel: Enterprise
ProductVersion: 7,0,1,116466 

x86 Windows 2003 version 5.2

So why would Application.cfm work and not application.cfc on CF7?


... and you're sure that the hosting environment is CF7?  does an
Application.cfm work?  can you dump the server scope to verify the CF
version?



~|
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:329179
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Null Pointers are another name for undefined values

2009-12-16 Thread Charlie Griefer

Not a clue... but I'm wondering if it has anything to do with restrictions
enforced by NSI.

Can you manually instantiate any other CFCs?

On Wed, Dec 16, 2009 at 8:40 AM, Steve Logan st...@sagescholars.com wrote:


 Application.cfm DOES work.

 Appserver:  JRun4
 ProductLevel: Enterprise
 ProductVersion: 7,0,1,116466

 x86 Windows 2003 version 5.2

 So why would Application.cfm work and not application.cfc on CF7?


 ... and you're sure that the hosting environment is CF7?  does an
 Application.cfm work?  can you dump the server scope to verify the CF
 version?
 


 

~|
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:329180
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Null Pointers are another name for undefined values

2009-12-16 Thread Steve Logan

Nope.  Both CreateObject and cfinvoke both throw the same null pointer errors.

Dammit!  I can hear it now I KNEW we should have just rewritten it from 
scratch in ASP - which is EXACTLY what they're going to say even though the 
site ran fine for years on the old host (that was charging them $200 / mo. for 
shared hosting), and at my host (which would be $200 / yr for CF8 + MySQL on a 
low volume shared server).


Not a clue... but I'm wondering if it has anything to do with restrictions
enforced by NSI.

Can you manually instantiate any other CFCs?


~|
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:329181
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Null Pointers are another name for undefined values

2009-12-16 Thread Charlie Griefer

Might want to ping NSI and see if they can do anything for you.

I had a shared host once that disabled createObject() by default, but upon
request they would enable it for whatever sandbox your site is in.

On Wed, Dec 16, 2009 at 9:08 AM, Steve Logan st...@sagescholars.com wrote:


 Nope.  Both CreateObject and cfinvoke both throw the same null pointer
 errors.

 Dammit!  I can hear it now I KNEW we should have just rewritten it from
 scratch in ASP - which is EXACTLY what they're going to say even though the
 site ran fine for years on the old host (that was charging them $200 / mo.
 for shared hosting), and at my host (which would be $200 / yr for CF8 +
 MySQL on a low volume shared server).


 Not a clue... but I'm wondering if it has anything to do with restrictions
 enforced by NSI.
 
 Can you manually instantiate any other CFCs?


 

~|
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:329182
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Null Pointers are another name for undefined values

2009-12-16 Thread Steve Logan

I submitted a ticket but I don't have much hope for it.  It took 7 days to get 
a simple DSN setup


Might want to ping NSI and see if they can do anything for you.

I had a shared host once that disabled createObject() by default, but upon
request they would enable it for whatever sandbox your site is in.



~|
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:329183
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Random errors from CFHTTP sending XML documents

2009-12-16 Thread Ben Nadel

I am also just getting this error on CF7. Starts happening after a random 
number of records that are sent.

Did you ever get to the bottom of this?

-Ben


 I have a couple of CF scripts that send out an XML doc to various 
 webservices (Google AdWords, for example).  Usually they all run just 
 fine, but from time to time I get the following error: You may only 
 use ONE cfhttpparam of type XML or BODY.  It happened again last 
 night on the simples of scripts:  One that loops over about 9000 
 entries in my database, and on each iteration sends the same XML 
 document (created via CFXML) to the same webservice - the only 
 difference between any of them is the login and account data that is 
 stuffed into the document.  The structure of the document is identical 
 each time - there is no conditional logic at all within the CFXML 
 block of code.
 
 Is this a known problem with the underlying Apache Axis code that 
 CFMX7 uses for webservices?  Is there a fix?
 
 On a related topic, is there a way to parse an XML document other than 
 the CFMX xmlParse() function?  It returns a structure, and in the case 
 of the XML docs returned by Google AdWords (and similar docs from 
 Yahoo! and MSN) they are a bit complex in terms of the number of 
 levels and the nesting of structures within arrays which are 
 themselves elements of the overall document structure. For small docs 
 this is not a problem, but the processing time for CF to go through 
 the info in the structure does not seem to be linear with respect to 
 it's size.  When I get back docs that have more than 3000 or so 
 elements in the nested array, the processing time skyrockets.  Any 
 hints or pointers to alternative strategies?
 
 Thanks all!
Reed 

~|
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:329184
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


CF MX 6.1 - zipping files

2009-12-16 Thread coldfusion . developer

I'm stuck with CFMX6.1 for our Intranet and need to zip up a csv file after I 
created it from a query output.  Anyone have any ideas how zip functions were 
done back in the day? 8-)

Thanks

D


~|
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:329185
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: CF MX 6.1 - zipping files

2009-12-16 Thread Alan Rother

Java

http://cflib.org/udf/ZipFileNew

http://cflib.org/udf/ZipFileNew=]

On Wed, Dec 16, 2009 at 10:54 AM, coldfusion.develo...@att.net wrote:


 I'm stuck with CFMX6.1 for our Intranet and need to zip up a csv file after
 I created it from a query output.  Anyone have any ideas how zip functions
 were done back in the day? 8-)

 Thanks

 D


 

~|
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:329186
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: CF MX 6.1 - zipping files

2009-12-16 Thread Charlie Griefer

http://www.newsight.de/2005/06/28/finished-work-on-zip-cfc/

Haven't used it, so can't vouch for it... but I do have a  CFMX7 gig I'm
working on, and will be looking to implement this in the next few days
myself.

On Wed, Dec 16, 2009 at 9:54 AM, coldfusion.develo...@att.net wrote:


 I'm stuck with CFMX6.1 for our Intranet and need to zip up a csv file after
 I created it from a query output.  Anyone have any ideas how zip functions
 were done back in the day? 8-)

 Thanks

 D


 

~|
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:329187
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: CF MX 6.1 - zipping files

2009-12-16 Thread Gerald Guido

Haven't used it, so can't vouch for it...

I have. Works fine on CF 7. At least I have not had any problems with it.
The doc header sez that it works on 6.x:

Support: ColdFusion MX 6.0, ColdFusion MX 6.1, ColdFusion MX 7

HTH

G!

On Wed, Dec 16, 2009 at 12:59 PM, Charlie Griefer charlie.grie...@gmail.com
 wrote:


 http://www.newsight.de/2005/06/28/finished-work-on-zip-cfc/

 Haven't used it, so can't vouch for it... but I do have a  CFMX7 gig I'm
 working on, and will be looking to implement this in the next few days
 myself.

 On Wed, Dec 16, 2009 at 9:54 AM, coldfusion.develo...@att.net wrote:

 
  I'm stuck with CFMX6.1 for our Intranet and need to zip up a csv file
 after
  I created it from a query output.  Anyone have any ideas how zip
 functions
  were done back in the day? 8-)
 
  Thanks
 
  D
 
 
 

 

~|
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:329188
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


CF 9 - cfparam problem - ORM function

2009-12-16 Thread Susan Gallegos

I am just starting with ORM so I downloaded samples from a talk by Ray Camden - 
his code works but when I make small changes I get an error for cfparam:

Ray's code:
h2Edit Person/h2

cfparam name=url.id default=0

cfif url.id neq 0
cfset person = entityLoadByPk(person, url.id)
cfelse
cfset person = new model.person()
/cfif

cfif structKeyExists(form, save)
cfset person.setFirstName(form.firstname)
cfset person.setLastName(form.lastname)
cfset person.setEmail(form.email)
cfset person.setHistory(form.history)
cfset person.setDOB(form.dob)
cfset entitySave(person)
cflocation url=index.cfm addToken=false
/cfif

cfparam name=form.firstname default=#person.getFirstName()#
cfparam name=form.lastname default=#person.getLastName()#
cfparam name=form.email default=#person.getEmail()#
cfparam name=form.history default=#person.getHistory()#
cfparam name=form.dob default=#person.getDOB()#

My code:
cfparam name=url.id default=0

cfif url.id neq 0
cfset user = entityLoadByPk(User, url.id)
cfelse
cfset user = new model.User()
/cfif

cfif structKeyExists(form, save)
cfset user.setName(form.name)
cfset user.setEmail(form.email)
cfset user.setActive(form.active)
cfset entitySave(User)
cflocation url=index.cfm addToken=false
/cfif

cfparam name=form.name default=#user.getName()#
cfparam name=form.email default=#user.getEmail()#
cfparam name=form.active default=#user.getActive()#

As I said - his code runs with no problem and my code chokes at the cfparam 
with default=#user.getName()# - if I set default to  I don't get the error.

Any ideas why his works and mine doesn't?
Thanks
Susan Gallegos 

~|
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:329189
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: CF MX 6.1 - zipping files

2009-12-16 Thread DURETTE, STEVEN J (ATTASIAIT)

If CF is on a Windows box and you have access to cfexecute, Windows
servers come with a built in command line version of Zip.

If you can get to a command prompt just type zip /? And you should get
the available commands.

Then cfexecute what you need to.

Steve


-Original Message-
From: Charlie Griefer [mailto:charlie.grie...@gmail.com] 
Sent: Wednesday, December 16, 2009 1:00 PM
To: cf-talk
Subject: Re: CF MX 6.1 - zipping files


http://www.newsight.de/2005/06/28/finished-work-on-zip-cfc/

Haven't used it, so can't vouch for it... but I do have a  CFMX7 gig I'm
working on, and will be looking to implement this in the next few days
myself.

On Wed, Dec 16, 2009 at 9:54 AM, coldfusion.develo...@att.net wrote:


 I'm stuck with CFMX6.1 for our Intranet and need to zip up a csv file
after
 I created it from a query output.  Anyone have any ideas how zip
functions
 were done back in the day? 8-)

 Thanks

 D


 



~|
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:329190
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


EntityLoadByExample

2009-12-16 Thread Charlie Stell

I was using EntityLoadByExample today and the behavior wasn't what I was
expecting.

I expected it would be able to replace the query I always do right before
insert (the check query) - to make sure that the insert wont conflict with
unique constraints.

Ive bee using it like this:

x = entityNew(a)

x.setP1(...)
x.setP2(...)
[...n]

if(isNUll(EntityLoadByExample(x)))
 x.save()
else
 x = EntityLoadByExample(x)

This works great whenever all the properties for a are simple
(fieldtype=column).

But when I tried this with an object that has a many-to-one defined, it
ignores this difference.

I've dumped x and EntityLoadByExample(x) right next to each other and see
that the parent object in the two dumps are different (different data, to
include pks).

Right now Im using

arrayLen(EntityLoad(a,{p1='#p1#',p2='#p2#',p3='#parent#'})) eq 0 in place
of isNUll(EntityLoadByExample(x)).

This seems to do the trick. But does anyone know if I know
if EntityLoadByExample should be able to handle this?


~|
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:329191
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: CF 9 - cfparam problem - ORM function

2009-12-16 Thread Dan Vega

The properties and their generated getters/setters are based on the Entity
that was created. He most likely has a person Entity (person.cfc) that
represents a person. In that file he has properties for each attribute of
person.

property firstname
proeprty lastname
property email

When you change his code to

person.setName() - Its looking for a property in that entity that does not
exist.

Make sure you go back and update the entity.

Thank You
Dan Vega
danv...@gmail.com
http://www.danvega.org/


On Wed, Dec 16, 2009 at 1:21 PM, Susan Gallegos galle...@ag.arizona.eduwrote:


 I am just starting with ORM so I downloaded samples from a talk by Ray
 Camden - his code works but when I make small changes I get an error for
 cfparam:

 Ray's code:
 h2Edit Person/h2

 cfparam name=url.id default=0

 cfif url.id neq 0
cfset person = entityLoadByPk(person, url.id)
 cfelse
cfset person = new model.person()
 /cfif

 cfif structKeyExists(form, save)
cfset person.setFirstName(form.firstname)
cfset person.setLastName(form.lastname)
cfset person.setEmail(form.email)
cfset person.setHistory(form.history)
cfset person.setDOB(form.dob)
cfset entitySave(person)
cflocation url=index.cfm addToken=false
 /cfif

 cfparam name=form.firstname default=#person.getFirstName()#
 cfparam name=form.lastname default=#person.getLastName()#
 cfparam name=form.email default=#person.getEmail()#
 cfparam name=form.history default=#person.getHistory()#
 cfparam name=form.dob default=#person.getDOB()#

 My code:
 cfparam name=url.id default=0

 cfif url.id neq 0
cfset user = entityLoadByPk(User, url.id)
 cfelse
cfset user = new model.User()
 /cfif

 cfif structKeyExists(form, save)
cfset user.setName(form.name)
cfset user.setEmail(form.email)
cfset user.setActive(form.active)
cfset entitySave(User)
cflocation url=index.cfm addToken=false
 /cfif

 cfparam name=form.name default=#user.getName()#
 cfparam name=form.email default=#user.getEmail()#
 cfparam name=form.active default=#user.getActive()#

 As I said - his code runs with no problem and my code chokes at the cfparam
 with default=#user.getName()# - if I set default to  I don't get the
 error.

 Any ideas why his works and mine doesn't?
 Thanks
 Susan Gallegos

 

~|
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:329192
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Two Column Select Box?

2009-12-16 Thread ColdFusion Developer

Anyone develop a selectbox that shows two columns of data but only one
value?

Example:

option value=1XYZ  |   XYZ Corporation/option
 option value=1ABCD   |   AB Corporation of Delaware/option


Goal is to still have the two columns aligned as well.

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:329193
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Two Column Select Box?

2009-12-16 Thread DURETTE, STEVEN J (ATTASIAIT)

Search through the data to get the largest length for the item in the
first column.

Then when you are doing your loop, do cfset Variables.myTempFirstCol =
FirstColValue  repeatString(nbsp, Variables.lenMax -
len(FirstColValue) /

Then output #Variables.myTempFirstCol#|#Variables.mySecondCol#

Since the first column will now be a fixed length everything should line
up.

Steve


-Original Message-
From: ColdFusion Developer [mailto:cfdev2...@gmail.com] 
Sent: Wednesday, December 16, 2009 4:29 PM
To: cf-talk
Subject: Two Column Select Box?


Anyone develop a selectbox that shows two columns of data but only one
value?

Example:

option value=1XYZ  |   XYZ Corporation/option
 option value=1ABCD   |   AB Corporation of Delaware/option


Goal is to still have the two columns aligned as well.

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:329194
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: CF 9 - cfparam problem - ORM function

2009-12-16 Thread Susan Gallegos

Thanks Dan. Ray sent me the answer so I will clarify here.

I had made all the modifications in the entity from person.cfc to user.cfc
as required to generate the proper getters/setters but I had not set the
defaults in the cfproperty defs - so I got the error in cfparam because the
values were null. Once I set the defaults in the entity, I didn't get the
errors.

Thanks for your quick response.
Susan

Susan Gallegos
Applications Systems Analyst, Sr.
ECAT - College of Agriculture and Life Sciences
Forbes 226
520-621-7181



-Original Message-
From: Dan Vega [mailto:danv...@gmail.com] 
Sent: Wednesday, December 16, 2009 1:36 PM
To: cf-talk
Subject: Re: CF 9 - cfparam problem - ORM function


The properties and their generated getters/setters are based on the Entity
that was created. He most likely has a person Entity (person.cfc) that
represents a person. In that file he has properties for each attribute of
person.

property firstname
proeprty lastname
property email

When you change his code to

person.setName() - Its looking for a property in that entity that does not
exist.

Make sure you go back and update the entity.

Thank You
Dan Vega
danv...@gmail.com
http://www.danvega.org/


On Wed, Dec 16, 2009 at 1:21 PM, Susan Gallegos
galle...@ag.arizona.eduwrote:


 I am just starting with ORM so I downloaded samples from a talk by Ray
 Camden - his code works but when I make small changes I get an error for
 cfparam:

 Ray's code:
 h2Edit Person/h2

 cfparam name=url.id default=0

 cfif url.id neq 0
cfset person = entityLoadByPk(person, url.id)
 cfelse
cfset person = new model.person()
 /cfif

 cfif structKeyExists(form, save)
cfset person.setFirstName(form.firstname)
cfset person.setLastName(form.lastname)
cfset person.setEmail(form.email)
cfset person.setHistory(form.history)
cfset person.setDOB(form.dob)
cfset entitySave(person)
cflocation url=index.cfm addToken=false
 /cfif

 cfparam name=form.firstname default=#person.getFirstName()#
 cfparam name=form.lastname default=#person.getLastName()#
 cfparam name=form.email default=#person.getEmail()#
 cfparam name=form.history default=#person.getHistory()#
 cfparam name=form.dob default=#person.getDOB()#

 My code:
 cfparam name=url.id default=0

 cfif url.id neq 0
cfset user = entityLoadByPk(User, url.id)
 cfelse
cfset user = new model.User()
 /cfif

 cfif structKeyExists(form, save)
cfset user.setName(form.name)
cfset user.setEmail(form.email)
cfset user.setActive(form.active)
cfset entitySave(User)
cflocation url=index.cfm addToken=false
 /cfif

 cfparam name=form.name default=#user.getName()#
 cfparam name=form.email default=#user.getEmail()#
 cfparam name=form.active default=#user.getActive()#

 As I said - his code runs with no problem and my code chokes at the
cfparam
 with default=#user.getName()# - if I set default to  I don't get the
 error.

 Any ideas why his works and mine doesn't?
 Thanks
 Susan Gallegos

 



~|
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:329195
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Two Column Select Box?

2009-12-16 Thread ColdFusion Developer

Tried that as well. Does not line up.

Ex:

 option value=13M |   XYZ Corporation/option
 option value=1ABCDY  |   AB Corporation of Delaware/option

The first one is 2 characters and 5 spaces
The second one if 5 characters and 2 spaces

Both equal 7 spaces :-(

I am wondering if the is a CSS way to do it.

On Wed, Dec 16, 2009 at 4:37 PM, DURETTE, STEVEN J (ATTASIAIT) 
sd1...@att.com wrote:


 Search through the data to get the largest length for the item in the
 first column.

 Then when you are doing your loop, do cfset Variables.myTempFirstCol =
 FirstColValue  repeatString(nbsp, Variables.lenMax -
 len(FirstColValue) /

 Then output #Variables.myTempFirstCol#|#Variables.mySecondCol#

 Since the first column will now be a fixed length everything should line
 up.

 Steve


 -Original Message-
 From: ColdFusion Developer [mailto:cfdev2...@gmail.com]
 Sent: Wednesday, December 16, 2009 4:29 PM
 To: cf-talk
 Subject: Two Column Select Box?


 Anyone develop a selectbox that shows two columns of data but only one
 value?

 Example:

 option value=1XYZ  |   XYZ Corporation/option
  option value=1ABCD   |   AB Corporation of Delaware/option


 Goal is to still have the two columns aligned as well.

 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:329196
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Two Column Select Box?

2009-12-16 Thread Charlie Griefer

You'd need to style the option to use a fixed-width font.

On Wed, Dec 16, 2009 at 2:03 PM, ColdFusion Developer
cfdev2...@gmail.comwrote:


 Tried that as well. Does not line up.

 Ex:

  option value=13M |   XYZ Corporation/option
  option value=1ABCDY  |   AB Corporation of Delaware/option

 The first one is 2 characters and 5 spaces
 The second one if 5 characters and 2 spaces

 Both equal 7 spaces :-(

 I am wondering if the is a CSS way to do it.

 On Wed, Dec 16, 2009 at 4:37 PM, DURETTE, STEVEN J (ATTASIAIT) 
 sd1...@att.com wrote:

 
  Search through the data to get the largest length for the item in the
  first column.
 
  Then when you are doing your loop, do cfset Variables.myTempFirstCol =
  FirstColValue  repeatString(nbsp, Variables.lenMax -
  len(FirstColValue) /
 
  Then output #Variables.myTempFirstCol#|#Variables.mySecondCol#
 
  Since the first column will now be a fixed length everything should line
  up.
 
  Steve
 
 
  -Original Message-
  From: ColdFusion Developer [mailto:cfdev2...@gmail.com]
  Sent: Wednesday, December 16, 2009 4:29 PM
  To: cf-talk
  Subject: Two Column Select Box?
 
 
  Anyone develop a selectbox that shows two columns of data but only one
  value?
 
  Example:
 
  option value=1XYZ  |   XYZ Corporation/option
   option value=1ABCD   |   AB Corporation of Delaware/option
 
 
  Goal is to still have the two columns aligned as well.
 
  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:329197
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Two Column Select Box?

2009-12-16 Thread Won Lee

On Wed, Dec 16, 2009 at 5:03 PM, ColdFusion Developer
cfdev2...@gmail.comwrote:


 Tried that as well. Does not line up.

 Ex:

  option value=13M |   XYZ Corporation/option
  option value=1ABCDY  |   AB Corporation of Delaware/option

 The first one is 2 characters and 5 spaces
 The second one if 5 characters and 2 spaces

 Both equal 7 spaces :-(

 I am wondering if the is a CSS way to do it.


What font are you using?

Will changing the type of font work?


~|
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:329198
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Two Column Select Box?

2009-12-16 Thread ColdFusion Developer

Thanks!  Its ugly looking to use Courier but it works...

On Wed, Dec 16, 2009 at 5:08 PM, Charlie Griefer
charlie.grie...@gmail.comwrote:


 You'd need to style the option to use a fixed-width font.

 On Wed, Dec 16, 2009 at 2:03 PM, ColdFusion Developer
 cfdev2...@gmail.comwrote:

 
  Tried that as well. Does not line up.
 
  Ex:
 
   option value=13M |   XYZ Corporation/option
   option value=1ABCDY  |   AB Corporation of Delaware/option
 
  The first one is 2 characters and 5 spaces
  The second one if 5 characters and 2 spaces
 
  Both equal 7 spaces :-(
 
  I am wondering if the is a CSS way to do it.
 
  On Wed, Dec 16, 2009 at 4:37 PM, DURETTE, STEVEN J (ATTASIAIT) 
  sd1...@att.com wrote:
 
  
   Search through the data to get the largest length for the item in the
   first column.
  
   Then when you are doing your loop, do cfset Variables.myTempFirstCol =
   FirstColValue  repeatString(nbsp, Variables.lenMax -
   len(FirstColValue) /
  
   Then output #Variables.myTempFirstCol#|#Variables.mySecondCol#
  
   Since the first column will now be a fixed length everything should
 line
   up.
  
   Steve
  
  
   -Original Message-
   From: ColdFusion Developer [mailto:cfdev2...@gmail.com]
   Sent: Wednesday, December 16, 2009 4:29 PM
   To: cf-talk
   Subject: Two Column Select Box?
  
  
   Anyone develop a selectbox that shows two columns of data but only one
   value?
  
   Example:
  
   option value=1XYZ  |   XYZ Corporation/option
option value=1ABCD   |   AB Corporation of Delaware/option
  
  
   Goal is to still have the two columns aligned as well.
  
   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:329199
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: EntityLoadByExample

2009-12-16 Thread Andrew Scott

Wouldn't throwing it in a try catch block be better than what your doing
here?

And I would refactor this

if(isNUll(EntityLoadByExample(x)))
 x.save()
else
 x = EntityLoadByExample(x)

as

x = EntityLoadByExample(x)
if(isNUll(x))
 x.save()
But I think for better understanding to what the code is doing placing it in
a try catch block, and checking for the exception of a constraint error
would be better and easier to read and understand in 6-12 months time.

On Thu, Dec 17, 2009 at 6:06 AM, Charlie Stell charlie.st...@gmail.comwrote:


 I was using EntityLoadByExample today and the behavior wasn't what I was
 expecting.

 I expected it would be able to replace the query I always do right before
 insert (the check query) - to make sure that the insert wont conflict
 with
 unique constraints.

 Ive bee using it like this:

 x = entityNew(a)

 x.setP1(...)
 x.setP2(...)
 [...n]

 if(isNUll(EntityLoadByExample(x)))
  x.save()
 else
  x = EntityLoadByExample(x)

 This works great whenever all the properties for a are simple
 (fieldtype=column).

 But when I tried this with an object that has a many-to-one defined, it
 ignores this difference.

 I've dumped x and EntityLoadByExample(x) right next to each other and see
 that the parent object in the two dumps are different (different data, to
 include pks).

 Right now Im using

 arrayLen(EntityLoad(a,{p1='#p1#',p2='#p2#',p3='#parent#'})) eq 0 in place
 of isNUll(EntityLoadByExample(x)).

 This seems to do the trick. But does anyone know if I know
 if EntityLoadByExample should be able to handle this?


 

~|
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:329200
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: EntityLoadByExample

2009-12-16 Thread Charlie Stell

Thanks for the reply Andrew,

I'm not sure I follow where your going with your suggestion of :
x = EntityLoadByExample(x)
if(isNUll(x))
 x.save()

x.save() would throw in error in the case that x is null.

In the majority of cases where this check is needed, it's a case of create
if needed, retrieve the instance either way - so with a try/catch I would
still need to retrieve the existing record.

However, even in cases where I want to enforce uniqueness, relying only on a
try-catch here requires that the unique constraint *actually* exist in the
database (which it certainly should - but even if it doesn't, it represents
a requirement to have clean clean ) and would likely end up leaving that
portion of the business logic separate from whats in the application layer
(I'm looking into how much of this can be housed solely in the ORM mapping
files via uniquekey).

But regardless of why EntityLoadByExample is being called, I still would
expect it to to only return instances matching all defined properties - both
data and object properties - still cannot nail down why it's not behaving
this way.

-Charlie




On Wed, Dec 16, 2009 at 5:39 PM, Andrew Scott andr...@andyscott.id.auwrote:


 Wouldn't throwing it in a try catch block be better than what your doing
 here?

 And I would refactor this

 if(isNUll(EntityLoadByExample(x)))
  x.save()
 else
  x = EntityLoadByExample(x)

 as

 x = EntityLoadByExample(x)
 if(isNUll(x))
  x.save()
 But I think for better understanding to what the code is doing placing it
 in
 a try catch block, and checking for the exception of a constraint error
 would be better and easier to read and understand in 6-12 months time.

 On Thu, Dec 17, 2009 at 6:06 AM, Charlie Stell charlie.st...@gmail.com
 wrote:

 
  I was using EntityLoadByExample today and the behavior wasn't what I was
  expecting.
 
  I expected it would be able to replace the query I always do right before
  insert (the check query) - to make sure that the insert wont conflict
  with
  unique constraints.
 
  Ive bee using it like this:
 
  x = entityNew(a)
 
  x.setP1(...)
  x.setP2(...)
  [...n]
 
  if(isNUll(EntityLoadByExample(x)))
   x.save()
  else
   x = EntityLoadByExample(x)
 
  This works great whenever all the properties for a are simple
  (fieldtype=column).
 
  But when I tried this with an object that has a many-to-one defined, it
  ignores this difference.
 
  I've dumped x and EntityLoadByExample(x) right next to each other and see
  that the parent object in the two dumps are different (different data,
 to
  include pks).
 
  Right now Im using
 
  arrayLen(EntityLoad(a,{p1='#p1#',p2='#p2#',p3='#parent#'})) eq 0 in
 place
  of isNUll(EntityLoadByExample(x)).
 
  This seems to do the trick. But does anyone know if I know
  if EntityLoadByExample should be able to handle this?
 
 
 

 

~|
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:329201
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: EntityLoadByExample

2009-12-16 Thread Andrew Scott

First I used your example posted, so your eample has that IsNULL error to
begin with.

Secondly, I am not sure why you need to retrieve the record again? When you
create an Entity, and then populate it and after saving there is no need to
retrieve it again as everything that is in the DB is populated in the
Entity.

If you are needing something more, then I suggest looking into optimistic
locking. ColdFusion 9 ORM allows a developer to define 2 more fields for
this exact behaviour. One is called version, and the other is timestamp. You
can either use one of the other, or both depending on how tight you want to
make this.

But at the end of the day reloading an Entity that has been saved is only
actually just wasting a DB call, as it will always be the same in this
situation you describe regardless.

There maybe more to what you are doing, but from what you have mentioned
your work flow process is overkill.

On Thu, Dec 17, 2009 at 10:07 AM, Charlie Stell charlie.st...@gmail.comwrote:


 Thanks for the reply Andrew,

 I'm not sure I follow where your going with your suggestion of :
 x = EntityLoadByExample(x)
 if(isNUll(x))
  x.save()

 x.save() would throw in error in the case that x is null.

 In the majority of cases where this check is needed, it's a case of create
 if needed, retrieve the instance either way - so with a try/catch I would
 still need to retrieve the existing record.

 However, even in cases where I want to enforce uniqueness, relying only on
 a
 try-catch here requires that the unique constraint *actually* exist in the
 database (which it certainly should - but even if it doesn't, it represents
 a requirement to have clean clean ) and would likely end up leaving that
 portion of the business logic separate from whats in the application layer
 (I'm looking into how much of this can be housed solely in the ORM mapping
 files via uniquekey).

 But regardless of why EntityLoadByExample is being called, I still would
 expect it to to only return instances matching all defined properties -
 both
 data and object properties - still cannot nail down why it's not behaving
 this way.

 -Charlie




~|
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:329202
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: EntityLoadByExample

2009-12-16 Thread Charlie Stell


 First I used your example posted, so your eample has that IsNULL error to
 begin with.

My example:

if(isNUll(EntityLoadByExample(x)))
 x.save() //If it's not found, save it - this will cause an insert without
problem
else
 x = EntityLoadByExample(x) //if it was found, use it

I think I see what you were meaning though -

I could use:
y = EntityLoadByExample(x,true)
if(isNull(y))
 x.save()// you don't want x to be null here.
else
 x = y
-This would avoid asking the system the same thing twice... a little better
on processing.



 Secondly, I am not sure why you need to retrieve the record again? When you
 create an Entity, and then populate it and after saving there is no need to
 retrieve it again as everything that is in the DB is populated in the
 Entity.

 This is to retrieve the record in subsequent requests where you have
neither the PK or the entity already identified.


 If you are needing something more, then I suggest looking into optimistic
 locking. ColdFusion 9 ORM allows a developer to define 2 more fields for
 this exact behaviour. One is called version, and the other is timestamp.
 You
 can either use one of the other, or both depending on how tight you want to
 make this.

 But at the end of the day reloading an Entity that has been saved is only
 actually just wasting a DB call, as it will always be the same in this
 situation you describe regardless.



 There maybe more to what you are doing, but from what you have mentioned
 your work flow process is overkill.


Here's an example - say I wan't to store email addresses as they come into
my mailbox - I have the properties set up like (and this is very
rough pseudo code):

component email
property - id fieldtype: id
property - user - fieldtype: column
property - domain - fieldtype:many-to-one cfc: domain
unique constraint on user and fkcolumn

component domain
property - fieldtype: id
property - name fieldtype:column
unique constraint on name

An email comes in, a scheduled task picks it up, and separates the
email-address into curUser and curDomain (both of which are just string)

This is the pattern I've been using:

domain = entityNew(domain);
domain.setName(curDomain)
check = entityLoadByExample(domain,true)
if(isNUll(check))
 domain.save()
else
 domain = check

email = entityNew(email)
email.setDomain(domain);
email.setUser(curUser);
check = entityLoadByExample(email,true)
if(isNUll(check))
 email.save()
else
 email = check


I know I could override the setDomain method for email here - but wouldn't
it essentially be have the domain-retrieve-or-create code in it?

Or am I missing something all together?

Thanks for the feedback!


~|
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:329203
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: EntityLoadByExample

2009-12-16 Thread Andrew Scott

Yeah first your right I missed the IsNull all together, but yeah you don't
need to call it twice.

Ok, I see what you are trying to do. But I stand by the fact you don't need
to read the thing in again. For example

domain = entityNew(domain);
domain.setName(curDomain)
email = entityNew(email)
email.setDomain(domain);
email.setUser(curUser);
domain.save();

If the relationship of your persistent components are setup correctly, this
will save the domain and the email as they are constrained by the FK. This
would eliminate you reloading the both entities as they both will have the
correct values associated with them.

Does this make more sense to you.


~|
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:329204
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: EntityLoadByExample

2009-12-16 Thread Charlie Stell

Maybe ORM will do more than I originally thought... If I start with two
empty tables - domain and email, and get an email from
x...@gmail.com(curDomain-gmail.com, curUser-xyz), and the code below
runs, two records
will be inserted (one in each table).
And then later on, I get an email form a...@gmail.com, I can run this exact
same code and it will know not to insert a new record into domain?

domain = entityNew(domain);
 domain.setName(curDomain)
 email = entityNew(email)
 email.setDomain(domain);
 email.setUser(curUser);
 domain.save();




~|
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:329205
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: EntityLoadByExample

2009-12-16 Thread Andrew Scott

That depends on how you are setup, if I recall right it will if it exists
update the records rather than insert them.

I haven't done it in this manner, but if it was me I would be rather be
try/catch around the block and not deal with updating or inserting.

The question needed to know here is what are you doing if a duplicate does
comes in, if you aren't doing anything with the database then versioning the
data and placining it into a try/catch block would ensure integrity here,
and do what ever you need to do then.

I am only guessing with a lot of what you are trying to do, but yeah the way
you are going about it seems complicated with no gain.




On Thu, Dec 17, 2009 at 12:52 PM, Charlie Stell charlie.st...@gmail.comwrote:


 Maybe ORM will do more than I originally thought... If I start with two
 empty tables - domain and email, and get an email from
 x...@gmail.com(curDomain-gmail.com, curUser-xyz), and the code below
 runs, two records
 will be inserted (one in each table).
 And then later on, I get an email form a...@gmail.com, I can run this exact
 same code and it will know not to insert a new record into domain?

 domain = entityNew(domain);
  domain.setName(curDomain)
  email = entityNew(email)
  email.setDomain(domain);
  email.setUser(curUser);
  domain.save();
 
 


 

~|
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:329206
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: EntityLoadByExample

2009-12-16 Thread Andrew Scott

Sorry I just reread your question.

Not in the state it is in no, what you will need to do is write a method to
do a search for that email first. The assumption then would be that if you
do something along the lines of this.

What you could do is replace the new Domain() and new Email() with
EntityLoads, this way you can get an empty entity back. I can't remember if
it returns null or an empty entity. So then you can either create the entity
if its null, or just do what you need to do.

I guess there are many ways to do what you are doing, but I think the amount
of DB calls you were making can potential be harmful if evedr you need to
scale your project.





On Thu, Dec 17, 2009 at 12:52 PM, Charlie Stell charlie.st...@gmail.comwrote:


 Maybe ORM will do more than I originally thought... If I start with two
 empty tables - domain and email, and get an email from
 x...@gmail.com(curDomain-gmail.com, curUser-xyz), and the code below
 runs, two records
 will be inserted (one in each table).
 And then later on, I get an email form a...@gmail.com, I can run this exact
 same code and it will know not to insert a new record into domain?

 domain = entityNew(domain);
  domain.setName(curDomain)
  email = entityNew(email)
  email.setDomain(domain);
  email.setUser(curUser);
  domain.save();
 
 


 

~|
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:329207
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: EntityLoadByExample

2009-12-16 Thread Charlie Stell

Man... I was getting excited at the prospect that CF would read the DB
structure, see the unique constraints on a table, realizes all the needed
properties were defined and try to identify it. Afterall, I just realized
the docs say ColdFusion automatically tries to find if a new record should
be inserted or an existing record be updated for the given entity... But it
looks like that means it just checks to see if the object has a value for
the pk or not?

So in the scenario that I don't already have a variable handle to the
object, or know its PK, but I do have the real world defining elements, it
looks like I'll have to search for it.

This is why the mentioned pattern (entitynew - loadbyexample - [user
returned or create new]) seemed so appetizing - if an existing entity is not
found, I already have the un-persisted entity I used for loadbyexample with
the bare essentials specified, and just have to use entitySave() on it.

I need to look at the debug stack to see which search-mechanism
(loadbyexample, load('',...criteria...),hql) is most efficient. Also, it'll
be interesting to see if running loadbyexample(a) twice right after each
other would cause to DB pulls, or if the second run will use the ORM cache
(not because theres any good reason to run them twice - but just to see how
the affect).

For any process having to do this type of task, doing anymore than 2 DB
calls per object is unacceptable - 1 to try to identify and 1 to do the save
if it doesn't already exist.

thanks for talking through this with me!


~|
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:329208
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Null Pointers are another name for undefined values

2009-12-16 Thread Jessica Kennedy

I've gotten this error before.  I don't know if this is the same thing or not, 
but in my case, I got the null pointers error only on the application start, a 
refresh would make it work.  anyway, it took me a few weeks, but the solution 
(at least in my case) was either checking or unchecking (i can never remember 
which... so just the opposite of whatever it is now) the maintain connections 
box in the coldfusion admin under database connections.  I had to call my 
hosting company to get it done, but they complied and I have never had the 
problem since.  HTH! 

~|
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:329209
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Possible thread issue?

2009-12-16 Thread Andre Kapp

 I'v now come across a code problem that I simply cannot understand 
 what is happending here.
 
 
 
 
 The code is part of a cfc module that is behind a web-service.
 This is not inside a loop - just a normal cfc with a function that 
 enter, process and returns data...
 
 
 
 The problem here is the transID.
 When you start putting a bit of load on this code, the transID gets 
 mangled/confused/
 When looking at the first cflog here, the trans id is the correct 
 value is an thedatabase table.
 However, after the values are assigned to stTrans, the trans id is 
 different! It is that of another tx that happend later on...
 
 
 
 
 Nowere is the transID updated in the code between the two cflog's. The 
 value in the cflog is correct, as it is this value that I receive on 
 the other side of the WebService module
 
 
 
 
 
 Here is the logfile output
 Look for card no 00213
 
 
 
 
 Information,jrpp-5,12/07/09,20:11:27,GCCSVPWS,Process tx for 
 xxx00213 with tx id 163537 and Thread.txid is 163537
 
 
 Information,jrpp-0,12/07/09,20:11:27,GCCSVPWS, Process tx 
 (after transaction) for x000346 with tx id 163537 and Thread.txid 
 is 163537
 Information,jrpp-4,12/07/09,20:11:27,GCCSVPWS, Process tx 
 (after transaction) for 38304 with tx id 163537 and Thread.txid is 
 163537
 Information,jrpp-7,12/07/09,20:11:27,GCCSVPWS,Process tx 
 for 254
 Information,jrpp-9,12/07/09,20:11:27,GCCSVPWS,Process tx 
 for xxx0270
 Information,jrpp-16,12/07/09,20:11:27,GCCSVPWS, Process tx 
 (after transaction) for xx005097 with tx id 163537 and Thread.txid 
 is 163537
 Information,jrpp-18,12/07/09,20:11:27,GCCSVPWS, Process tx 
 (after transaction) for xx00239 with tx id 163537 and Thread.txid 
 is 163537
 Information,jrpp-19,12/07/09,20:11:27,GCCSVPWS, Process tx 
 (after transaction) for xx00304 with tx id 163537 and Thread.txid 
 is 163537
 Information,jrpp-8,12/07/09,20:11:27,GCCSVPWS,Process tx 
 for x12 with tx id 163538 and Thread.txid is 163538
 Information,jrpp-9,12/07/09,20:11:27,GCCSVPWS,Process tx 
 for x270 with tx id 163539 and Thread.txid is 163539
 Information,jrpp-3,12/07/09,20:11:27,GCCSVPWS, Process tx 
 (after transaction) for 0288 with tx id 163539 and Thread.txid 
 is 163539
 Information,jrpp-7,12/07/09,20:11:27,GCCSVPWS,Process tx 
 for xxx254 with tx id 163540 and Thread.txid is 163540
 Information,jrpp-5,12/07/09,20:11:27,GCCSVPWS, Process tx 
 (after transaction) for xx0213 with tx id 163540 and Thread.
 txid is 163540
 
 
 
 
 
 
 
 
 
 
 I found a problem when I did code optimizationon the other side of the 
 webservice. First thought it was the web service, but trace it right 
 down to this bit of code on the one server.
 
 
 
 
 This is happening on my Mac's VM's running CentOS 5.2 and Coldfusion 8 
 on top of that.
 
 Coldfusion details:
 Server ProductColdFusion
 Version   8,0,1,195765 
 
 
 
 Operating System  UNIX 
 OS Version2.6.18-128.2.1.el5 
 JVM Details
 Java Version  1.6.0_04 
 
 
 
 
 Database is MySQL version 5.0
 
 
 
 
 
 
 
 Any any any  ideas will be appreciated!
 
 
 
 
 
 
 
 
 
 
 snipped 
 
 
 
 

 SELECT last_insert_id() AS transid;

 /cfquery
 
 
 
 

 cfset theTransID = trans_insert.transid

 cfset Thread.txid = trans_insert.transid
   
 

 cflog file=transdao_cfc text=Process tx for #cardnumber# with tx 
 id #theTransID# and Thread.txid is #Thread.txid# type=information
   
 

 !--- Update acct balance on gateway ---

 cfquery datasource=#variables.dsn#

 UPDATE acct_balances

 SET

 acct_balance = acct_balance + #arguments.amount#,

 acct_balance_available = acct_balance_available + #arguments.amount#

 WHERE

 acct_id = cfqueryparam cfsqltype=CF_SQL_INTEGER value=#arguments.
 acctid#

 /cfquery
 
 
 
 
   
 /cftransaction
 
 
 
 

!-- -

 CHECK FOR NEG to POS

 

 cftry

 cfif theCurrentActualBalance LT 0 AND theNewActualBalance GTE 0

 cfquery datasource=#variables.dsn#

 UPDATE fees_collection

 SET

 settled = cfqueryparam cfsqltype=CF_SQL_INTEGER value=1,

 settled_trans_id = cfqueryparam cfsqltype=CF_SQL_INTEGER 
 value=#theTransID#,

 settled_dttm = NOW()

 WHERE

 acct_id = cfqueryparam cfsqltype=CF_SQL_INTEGER value=#arguments.
 acctid# AND
   

CF/Java assistance; Path questions

2009-12-16 Thread Seth Stone

Hello,

I've just installed CF9 Enterprise on RHEL 5 and am trying to understand the
Java paths.  I've created an instance called myinstance1.  In the admin for
myinstance1 under Settings Summary there are a couple of Java path listings.

CF Server Java Class Path - seems to contain every jar in
/opt/jrun4/servers/myinstance1/cfusion.ear/cfusion.war/WEB-INF/cfusion/lib/
as well as a few other directories under WEB-INF

Java Class Path - contains various JARs not in the CF Server Java Class
Path.

My guess is that the Java Class Path is sort of JRun's environment and that
the CF Server Java Class Path is the Java paths available to ColdFusion
itself and possibly code that I create using CreateObject(java, ...)

1) So, is any of that correct?

2) I have a webstore application (AbleCommerce CFMX) that requires that I
add a number of provided JARs to the WEB-INF\lib directory.  How does this
directory fit into the above two sets of Java paths?  It appears that I can
also call CreateObject(java, ...) on any of the objects in one of the JARs
in this directory as well.

I'm trying to piece some things together, and know very little about Java.
 Any insights would be appreciated.


~|
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:329211
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Possible thread issue?

2009-12-16 Thread Leigh

 After changing/updating/fixing/etc the code now runs 100%
 reliable and fast! Code put into production yesterday and
 looking good!

That is good to hear!

-Leigh


  

~|
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:329212
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Available CF Developer / Manage Servers / SEO and more ...

2009-12-16 Thread Coldfusion Developer

I am currently looking for an ongoing relationship with a company that needs
20 hours minimum a week of work.  I have been developing in CF since version
3.1 where I picked up CF working at Allaire.  I have 2 years experience
with managing cloud data centers (GoGrid and Amazon EC2).  Highly capable at
SEO and can demonstrate that easily upon request.  If you need someone to
wear multiple hats then I am that person.

My resume is available upon request.  I would be more forth coming with
information here but I am currently employed.

Regards


~|
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-jobs-talk/message.cfm/messageid:4268
Subscription: http://www.houseoffusion.com/groups/cf-jobs-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.11