ColdSpring should generally only be used to create and manage
singletons, if that answers the question.

mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/



2009/7/26 Glyn Jackson <[email protected]>:
>
> 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:324987
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