Is there a way to reset the JRun server from within a ColdFusion page?
I believe the answer is no for security reasons. It would be bad from a security stand point for an application to be able to modify the JVM that it was running in...
No, you can't do that.
But just a suggestion if I may (and I don't mean to sound condescending here):
If you are trying to do a restart because of server performance I suggest you troubleshoot the real issue before even attempting to implement something like this.
- Check your exception logs
- Start using server monitoring
- Check system resources
See where that leads you.
We used to have to restart our CF servers a lot, but with careful understanding of the problems and subsequent fixing we would very rarely need to do that now.
I hope that helps.
Yep, you can restart any service you want. Just write a batch file and run with cfexecute.
<cfexecute name="#filepath#restartjrun.bat"></cfexecute>
In the batch file something like:
net stop "Macromedia JRun CFusion Server"
net start "Macromedia JRun CFusion Server"
As Ciaran mentioned though, it's always best to solve performance problems than rely of temporary fixes like this.