Here is the initial release of my Captcha component .
It is a reworking of the code I use on this site to output my Captcha images, into a nice CFC that has two public methods -
- captchaToFile(...) - This method writes a Captcha image defined by the arguments passed in to the file you tell it to set.
- captchaToBinary(...) - This returns binary data that can be used by cfcontent to display the generated image on the fly.
The code here is pretty much 'as is'. The CFC should be relatively self explanatory, but I have provided examples in the zip file on how to use the CFC both ways.
If you have any feedback, feel free to send me an email .
Version 0.3 of Transfer ORM is now ready for download .
New things to look for in this release:
- The 'generate' attribute on the ID element - now you have to specify if you want Transfer to generate primary keys for you. Otherwise it defaults to the new ability to retrieve database generated primary keys.
- Primary keys are now set to default values.
- A new method on the Transfer class - save(). This intelligently will either create, or update the transfer object dependent on its current state.
- If you are using Transfer to create your primary keys, you no longer need to create the transfer_sequence table. Transfer now does this behind the scenes.
- All the bugs with UUID primary keys have been fixed.
- The transfer.xsd has been fixed up so that attributes that should have been set to 'required' are now.
There are a few more pieces, but they are all outlined in the change log and the documentation .
The tBlog example application has also been updated to use the new functionality, and can be downloaded from here.
Please do not forget that there is a mailing list for Transfer, and any and all feedback is appreciated.
Time for me to admit I was wrong...
All the time I've been getting ColdFusion errors stating that the server cannot support any more connections... it wasn't the server, it was some code I had written.
I'm still not sure of the why it caused the problems that it did, but it certainly did.
The issue at hand was my Captcha images that i was generating on the fly.
The idea was I would generate a BufferedImage , draw all my stuff on it, grab the HttpServletResponse OutputStream from the getPageContext() and then use the com.sun.image.codec.jpeg.JPEGCodec to encode said OutputStream to my captcha.
In theory this should all work like a charm.
Except for one very irritating thing. It doesn't.
Occasionally when multiple requests go for the JpegEncoder, ColdFusion decides to go totally belly up. Not even in a nice error message way, nope, in a 'Oh my G-d, I've totally dropped my &%$#' way.
It even got to the point where it was dropping out the whole server.
The way I have gotten around it now, is by writing the image to a file, and every so often replacing it with a new Captcha image and text. It seems to be working very nicely, and with some locking, ensures that it should only get hit one at a time.
So, in the future, I highly recommend not encoding the OutputStream of the HttpServletResponse - write it to a file, and access it that way.
Things have been pretty hectic of late, which is why you haven't seen much of anything on the site.
I've been traipsing around the USA for the last few weeks, and will continue to be in Santa Clara, CA until the 1st of February.
Depending on what happens next week, I'm going to attempt to wander up to the BACFUG
meeting on Wednesday.
There is a heap of new pieces for Transfer
coming in the works, including support for database auto-generated numbers, list() and read() functions, the ability to turn off and/or control the persistent caching mechanism, and some other things I can't remember right now (and those people bugging me for those things know who they are, yes, they are coming).
I know the server has been up and down as of late - nothing I can really do about it, hopefully my hosting service will get it sorted sooner rather than later.
Finally, a blatant plug for a good friend of mine's new graphics design / illustration site - One Strange Day
. Check it out, it's very pretty.