Skip to end of metadata
Go to start of metadata


The Carbonado plugin enables lightweight access to JDBC, BerkeleyDB or in-memory datastores using Carbonado. This plugin does NOT provide domain classes nor dynamic finders like GORM does.


The current version of griffon-carbonado is 0.3
To install just issue the following command


Upon installation the plugin will generate the following artifacts at $appdir/griffon-app/conf:

  • Carbonado.groovy - contains the datasource and pool definitions. Its format is equal to GORM's requirements.
  • BootstrapCarbonado.groovy - defines init/destroy hooks for data to be manipulated during app startup/shutdown.

A new dynamic method named withCarbonado will be injected into all controllers, giving you access to a object, with which you'll be able to make calls to the datastore. Remember to make all calls to the database off the EDT otherwise your application may appear unresponsive when doing long computations inside the EDT.

This method is also accessible to any component through the singleton griffon.plugins.carbonado.CarbonadoConnector. You can inject these methods to non-artifacts via metaclasses. Simply grab hold of a particular metaclass and call CarbonadoConnector.enhance(metaClassInstance).


Dynamic method injection

The withCarbonado() dynamic method will be added to controllers by default. You can change this setting by adding a configuration flag in Config.groovy

Selecting a repository type

The Carbonado plugin supports 3 types of repositories: JDBC, BerkeleyDB and in-memory. You can select which one to use by configuring the following flag in Config.groovy

This flag accepts the following values: jdbc, bdb and map. The last option is the default if no preference is specified.


The following events will be triggered by this addon

  • CarbonadoConnectStart[config] - triggered before connecting to the datastore
  • CarbonadoConnectEnd[repo] - triggered after connecting to the datastore
  • CarbonadoDisconnectStart[config, repo] - triggered before disconnecting from the datastore
  • CarbonadoDisconnectEnd[] - triggered after disconnecting from the datastore


Follow these steps to create a simple application that displays data stored inside a database.

1. Create a new application named 'sample'


Following steps must be executed inside the application's directory

2. Install the Carbonado plugin

3. Setup the database schema. Create the file griffon-app/resources/schema.ddl with the following content

DataBase Specific Content


The schema.ddl file must contain RDBMS specific DDL statements

4. Create a model class in src/main/samples/

5. Setup bootstrapping data. Edit griffon-app/conf/BootstrapCarbonado.groovy (We'll use the Griffon's team roster, feel free to input your own data)

6. Download a copy of GlazedLists' latest stable release. Place it under $appdir/lib. Or install the Glazedlists Plugin (recommended!).

7. Edit griffon-app/models/sample/SampleModel.groovy by adding a personList property.

GlazedLists' EventList simplifies working with JList, JTable and their models as you will soon find out.

8. Edit griffon-app/views/sample/SampleView.groovy. We'll add a scrollPane and a table. The Table's model will be tied to model.people.

9. Finally edit griffon-app/controllers/sample/SampleController.groovy. The controller will react to an application event, load the data into a temporal List then update model.people inside the EDT.

10. Run the application by typing

A trivial sample application can be found at







Release sync with Griffon 0.9.4



Upgraded to bdb-je-4.1.10



Initial release

  • No labels