Using Oracle Coherence with Grails Part I (Fernando Takai)

, , August 25th, 2008

Original Source

Fernando Takai has been experimenting with Oracle Coherence lately. In case you haven’t heard of Oracle Coherence before, it is a JCache -compliant in-memory distributed data grid solution for clustered applications and application servers, in other words a fast and reliable way to keep your data ready when the request load gets ugly. Fernando is also a developer fond of Grails, so he decided to test Coherence as a second-level cache for Hibernate, driven by GORM of course.

He first demonstrates the basics of running Coherence and making sure that it is working. The next step involves defining the configuration of the second-level cache (for which he provides a pastebin url, nice). Finally enabling the cache and running Grail’s console. Some useful bits of information are thrown along the way, like enabling your domain classes to be cached.

Those steps are sufficient enough to get you up to speed should you decided to try it. We are sure there are plenty of knobs and levers you can turn and switch to tweak the secon-level cache. Fernando promises to describe how to embed the cache into a real app and do some tuning in a future installment.

Tags: , ,

Setting up Grails to Work with JEE Role Based authentication (Dave Cherry)

, , , August 22nd, 2008

Original Source

Dave Cherry has written a step-by-step guide for setting JEE style role based authentication (that means realms) as a way to secure your Grails application. This guide is not for the faint of heart, it requires you to roll your sleeves and edit a couple of files residing in your GRAILS_HOME directory, not your project_home directory, meaning the changes will be system wide and not project wide. Despite this minor inconvenient Dave is sure to point to alternatives and other useful JEE security links that will help you along the way.

JEE role based security provides a means of controlling access to resources configured at the application server level. On some larger projects or within corporations this type of access control may be mandated. Due to the fact that the application server controls the security, several applications can share the same realm and therefore share the same credentials, this can be a big plus on large websites, spanning multiple applications.

If you are not familiar with role based authentication look at Using Role based security and tomcat realm how to. Also note that Grails has other options for handling security including the ones listed here grails security plug-ins.

In order to use role based authentication with Grails, several changes are required. Unfortunately one of the cases requires that the actual runtime be changed. However, this change is very straightforward and documented here. Note any references to grailshome, actually refer to the directory where Grails itself is installed and not a Grails project.

Continue reading the full article at The Coder’s Corner.

Tags: , , ,