Blog

Extending a ColdBox App's Lock Timeouts

Luis Majano March 12, 2009

Spread the word

Luis Majano

March 12, 2009

Spread the word


Share your thoughts

By default, any ColdBox app has a lock timeout of 30 seconds for their requests.  If longer running processes occur in which they do not give the lock away (for whatever reason it is) there could be a chance of the request to timeout and throw and error.  Therefore, you might be interested in maybe increasing it on high availability applications in order to allow longer running processes to finish.  In order to tweak this setting, you should open your Application's Application.cfc file.
* This only works on Application.cfc's that use inheritance. Non-inheritance Application.cfc will have to wait for ColdBox 3.0 or manually change this in the main coldbox.cfc
Once inside the file, locate the following: And add the following snippet: That's it! You use the setTimeout() method and pass in an integer that denotes the number of seconds to wait for a lock. Now, most of the time, if you have processes taking longer than 30-45 seconds, that to me is a red-flag going up. You should seriously revise your code and processes of why you want processes running for so long.

Add Your Comment

(3)

Mar 13, 2009 20:28:03 UTC

by Gabriel

One may not want processes running for too long on public facing sites. However, if you have private management type pages that may run for a long time but they work well otherwise, what's your recommendation for including those in an application? I tested a long running page and it caused a timeout error on the public facing part of the site. Is the only option to move those long running pages into their own "app" so that it doesn't interfere with the public side? Thank you, Gabriel

Mar 14, 2009 08:26:25 UTC

by Gabriel

So, I looked into the framework code and found that my timeout error was occurring because, in a development environment, I am "auto reloading" everything with each request. So the long running request caused the public side request to fail because it couldn't get a lock in the "AutoReload Tests" of coldbox.cfc. That said, I changed to a "production" environment (doesn't reload everything on every request) and the long running request did not bring down the public facing side. I think I should be ok leaving these long running pages as part of the same app as the issue does not happen with real production settings. If you'd advise otherwise, please let me know.

Mar 16, 2009 12:56:05 UTC

by Luis Majano

Yes, auto reload puts a lot of stress on the application because every request has to do exclusive locking just to make sure the app get's reloaded. Definitely use it for development only if possible. Lock timeouts and request timeouts are two different settings.

Recent Entries

Ortus June 2024 Newsletter!

Ortus June 2024 Newsletter!

Welcome to the latest edition of the Ortus Newsletter! This month, we're excited to bring you highlights from our sessions at CFCamp and Open South Code, as well as a sneak peek into our upcoming events. Discover the latest developments in BoxLang, our dynamic new JVM language, and catch up on all the insightful presentations by our expert team. Let's dive in!

Maria Jose Herrera
Maria Jose Herrera
June 28, 2024
BoxLang June 2024 Newsletter!

BoxLang June 2024 Newsletter!

We're thrilled to bring you the latest updates and exciting developments from the world of BoxLang. This month, we're diving into the newest beta release, introducing a new podcast series, showcasing innovative integrations, and sharing insights from recent events. Whether you're a seasoned developer or just getting started, there's something here for everyone to explore and enjoy.

Maria Jose Herrera
Maria Jose Herrera
June 28, 2024
BoxLang 1.0.0 Beta 3 Launched

BoxLang 1.0.0 Beta 3 Launched

We are thrilled to announce the release of BoxLang 1.0.0-Beta 3! This latest beta version is packed with exciting new features and essential bug fixes, including robust encryption functionality, enhanced Java interoperability, and more efficient event handling. Key highlights include the introduction of query caching capabilities, seamless coercion of Java Single Abstract Method (SAM) interfaces from BoxLang functions, and support for virtual thread executors. So, let’s dive into the details of what’s new in BoxLang 1.0.0-Beta 3 and how you can start leveraging these updates today!

Luis Majano
Luis Majano
June 28, 2024