JPA/EclipseLink multitenancy screencast

Posted by alexismp on Oracle Blogs See other posts from Oracle Blogs or by alexismp
Published on Tue, 28 Jun 2011 15:21:01 -0700 Indexed on 2011/06/29 0:26 UTC
Read the original article Hit count: 620

Filed under:

I find JPA and in particular EclipseLink 2.3 to be particularly well suited to illustrate the concept of multitenancy, one of the key PaaS features en route for Java EE 7.

Here's a short (5-minute) screencast showing GlassFish 3.1.1 (due out real soon now) and its EclipseLink 2.3 JPA provider showing multitenancy in action. In short, it adds EclipseLink annotations to a JPA entity and deploys two identical applications with different tenant-id properties defined in the persistence.xml descriptor. Each application only sees its own data, yet everything is stored in the same table which was augmented with a discriminator column.

For more advanced uses such as tenant property being set on the @PersistenceContext, XML configuration of multitenant JPA entities, and more check out the nicely written wiki page.

© Oracle Blogs or respective owner

Related posts about /GlassFish