I have another question regarding ColdSpring and ColdBox. I will be using it to 
create a bean on the init() method of my handler, I will not create the object 
again after that. This bean contains all my SQL and database interactions 
(example below). My question is, singletons. is this ok, I dont see how doing 
this be an issue as long as I var inside the CFC right?

example code inside my CFC

<cffunction name="getproductListDep" returntype="query">
<cfargument name="storeId" type="numeric" required="yes" default="1">
<cfargument name="depId" type="numeric" default="0"> 
<cfargument name="pagesize" type="numeric" default="5"> 
<cfargument name="targetpage" type="numeric" default="1">  
<cfargument name="highest" type="numeric" default="0">           
<cfquery name="qryResult"  datasource="#instance.dsn.getName()#" 
username="#instance.dsn.getUsername()#" password="#instance.dsn.getPassword()#">
    EXECUTE usp_listDepartments
    @PageSize = <cfqueryparam cfsqltype="cf_sql_varchar" maxlength="4" 
value="#arguments.pagesize#" />,
    @TargetPage = <cfqueryparam cfsqltype="cf_sql_varchar" maxlength="4" 
value="#arguments.targetpage#" />,
    @Highest = <cfqueryparam cfsqltype="cf_sql_varchar" maxlength="2" 
value="#arguments.highest#" />,
    @Sto = <cfqueryparam cfsqltype="cf_sql_varchar" maxlength="4" 
value="#arguments.storeId#" />, 
    @Dept = <cfqueryparam cfsqltype="cf_sql_varchar" maxlength="4" 
value="#arguments.depId#" />
</cfquery>
<cfreturn qryResult>
</cffunction>

 

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

Reply via email to