As of EclipseLink Indigo (2.3.0) you have been able to use the @Multitenant feature to share a database schema between multiple tenants. Did you know that you can also use this feature together with the Oracle Virtual Private Database (VPD) support that has been available in EclipseLink since version 1.0?
This powerful combination of features allows for the shared tables to be managed directly on the database, and for inserts to be automatically associated with the proper client. Any SQL executed by EclipseLink (even if EclipseLink did not generate it - ie native queries) will go through VPD and return only the client specific rows.
Since VPD can be configured per table, applications can be configured to use VPD on some tables, and share others.
A running example, complete with source code is available on the EclipseLink wiki.
Tuesday, August 23, 2011
Thursday, July 28, 2011
GlassFish 3.1.1 Ships with EclipseLink 2.3!
GlassFish 3.1.1 shipped today which makes it the first application server with the new multi-tenancy and extensible persistence unit support as well as all the other new features included in EclipseLink 2.3. If you're a GlassFish developer and you're upgrading to 3.1.1 you can find out all about the new features available in EclipseLink 2.3 on the EclipseLink Wiki.
To wet your appetite, Alexis Moussine-Pouchkine posted a screencast of building a multi-tenant enabled application on a pre-release build of GlassFish 3.1.1 on his blog and now would be a great time to check it out!
Shaun Smith, EclipseLink Team
@shaunmsmith
To wet your appetite, Alexis Moussine-Pouchkine posted a screencast of building a multi-tenant enabled application on a pre-release build of GlassFish 3.1.1 on his blog and now would be a great time to check it out!
Shaun Smith, EclipseLink Team
@shaunmsmith
Wednesday, June 22, 2011
EclipseLink 2.3.0 (Indigo) Released
Since joining the family here at Eclipse a few years ago, one thing I can always count on is a hectic and exciting start to summer. This summer is no exception, and is kicked off with the release of EclipseLink 2.3.0 (Indigo).
Before I continue with brief descriptions of some of the new features of EclipseLink 2.3.0, I would like to thank everyone who was involved with this release. Whether your contribution to the project consisted of finding and entering bugs, contributing to the forums, or designing and implementing features, your contribution was important to the success of this project. Thank you, and I look forward to your contributions to our next major releases.
There are too many features and enhancement requests to touch on everything in this blog post, so I am going to limit it to what I believe are the highlights. For a complete 2.3.0 feature list, and to download and try out some of this stuff yourself, please click here.
Extend Entities
2.3.0 offers EclipseLink users the ability to extend their model (JPA entities or MOXy JAXB beans) so that a set of additional extended mappings can be used at runtime. These additional mappings offer more flexibility for developers that may not know all the mappings required for the application at design time.
Support Multiple Tenants
2.3.0 offers developers the ability to design and deploy applications where their persistent entities for multiple tenants are stored in a shared table. A column (or columns) in the table is designated as the discriminator for the tenant.
Externalize Mappings
Mappings for your model (JPA entities or MOXy JAXB beans) can now be stored externally to the running application. This allows mapping overrides and extended mappings (new in 2.3.0) to be easily and dynamically integrated into deployed applications.
Multiple Database
Developers can now store different entities in different databases, and even have relationships between them using Composite Persistence Units (PU). This feature gives developers the ability to build persistence units, each connecting to their own datasource, and compose them together under a parent PU. The parent PU is then used as if it is a standard persistence unit.
Click here for more information, including examples and docs, on the above features, and to download 2.3.0.
Peter
Before I continue with brief descriptions of some of the new features of EclipseLink 2.3.0, I would like to thank everyone who was involved with this release. Whether your contribution to the project consisted of finding and entering bugs, contributing to the forums, or designing and implementing features, your contribution was important to the success of this project. Thank you, and I look forward to your contributions to our next major releases.
There are too many features and enhancement requests to touch on everything in this blog post, so I am going to limit it to what I believe are the highlights. For a complete 2.3.0 feature list, and to download and try out some of this stuff yourself, please click here.
Extend Entities
2.3.0 offers EclipseLink users the ability to extend their model (JPA entities or MOXy JAXB beans) so that a set of additional extended mappings can be used at runtime. These additional mappings offer more flexibility for developers that may not know all the mappings required for the application at design time.
Support Multiple Tenants
2.3.0 offers developers the ability to design and deploy applications where their persistent entities for multiple tenants are stored in a shared table. A column (or columns) in the table is designated as the discriminator for the tenant.
Externalize Mappings
Mappings for your model (JPA entities or MOXy JAXB beans) can now be stored externally to the running application. This allows mapping overrides and extended mappings (new in 2.3.0) to be easily and dynamically integrated into deployed applications.
Multiple Database
Developers can now store different entities in different databases, and even have relationships between them using Composite Persistence Units (PU). This feature gives developers the ability to build persistence units, each connecting to their own datasource, and compose them together under a parent PU. The parent PU is then used as if it is a standard persistence unit.
Click here for more information, including examples and docs, on the above features, and to download 2.3.0.
Peter
Friday, June 17, 2011
EclipseLink Indigo Preview: Shared Databases for Multiple Tenants
Challenged to take an existing application and re-use it for a new customer or group of users (tenant)? Instead of customizing the application, adding new hardware or re-configuring the database for each new tenant, you can now build EclipseLink JPA enabled applications hosting requests from multiple tenants with all their data co-located.
Starting with EclipseLink 2.3, part of the annual Eclipse Indigo release, you can now have multiple application tenants sharing a database schema. EclipseLink enables you to configure your database tables for shared storage by simply providing tenant discriminator column(s) and providing values for these discriminators within your application. This allows your tenants to share the same schema without being aware of one another.
Of course in some instances, you may wish to share some data across tenants. No problem! EclipseLink allows you to share and isolate as much or as little as your application requires.
The beauty and ease of creating such an environment lies simply in decorating those entities that need to be isolated per tenants with an @Multitenant specification. Shared entities need not be configured any further then required by the JPA specification.
For more information on how to take advantage of this new functionality, follow the link:
http://wiki.eclipse.org/EclipseLink/Examples/JPA/Multitenant
Please note: The final release date for EclipseLink 2.3 is June 22, 2011 and the examples and documentation will evolve as the release date approaches. If you would like more detail, please check back after the release date or take advantage of our mailing lists and forums.
Starting with EclipseLink 2.3, part of the annual Eclipse Indigo release, you can now have multiple application tenants sharing a database schema. EclipseLink enables you to configure your database tables for shared storage by simply providing tenant discriminator column(s) and providing values for these discriminators within your application. This allows your tenants to share the same schema without being aware of one another.
Of course in some instances, you may wish to share some data across tenants. No problem! EclipseLink allows you to share and isolate as much or as little as your application requires.
The beauty and ease of creating such an environment lies simply in decorating those entities that need to be isolated per tenants with an @Multitenant specification. Shared entities need not be configured any further then required by the JPA specification.
For more information on how to take advantage of this new functionality, follow the link:
http://wiki.eclipse.org/EclipseLink/Examples/JPA/Multitenant
Please note: The final release date for EclipseLink 2.3 is June 22, 2011 and the examples and documentation will evolve as the release date approaches. If you would like more detail, please check back after the release date or take advantage of our mailing lists and forums.
Friday, June 10, 2011
Extend your Persistence Unit on the fly
Imagine a system that keeps track of player statistics in a sports league. Personal information such as name, height, weight and basic statistics such as the number of games played is stored for all players.
A persistence unit is deployed with all the mappings described above.
The system admin of a basketball league wants to use the system and add mappings for points scored and fouls. As the system is running they tell EcliseLink about mappings for those fields and the next EntityManager they get uses them.
Starting with EclipseLink 2.3, you can do just that. To do that, all you have to do is:
- Build a traditional persistence unit
- Tweak your Entities so they can hold added mappings
- Build room for additional data into your database schema
- Define a repository to contain your additional mappings and tell EclipseLink about it
With those steps, any EntityManager created from your persistence unit will use your new mappings.
Additionally, you can refresh your EntityManagerFactory. Any EntityManager created after the refresh will use any new mappings added to the repository since the previous refresh.
The following link shows an example of how a system as described above could be configured. Please note: The final release date for EclipseLink 2.3 is June 22, 2011 and the examples and documentation will evolve as we get closer to that date. If you would like more detail, please check back after the release date or take advantage of our mailing lists and forums.
http://wiki.eclipse.org/EclipseLink/Examples/JPA/Extensibility
A persistence unit is deployed with all the mappings described above.
The system admin of a basketball league wants to use the system and add mappings for points scored and fouls. As the system is running they tell EcliseLink about mappings for those fields and the next EntityManager they get uses them.
Starting with EclipseLink 2.3, you can do just that. To do that, all you have to do is:
- Build a traditional persistence unit
- Tweak your Entities so they can hold added mappings
- Build room for additional data into your database schema
- Define a repository to contain your additional mappings and tell EclipseLink about it
With those steps, any EntityManager created from your persistence unit will use your new mappings.
Additionally, you can refresh your EntityManagerFactory. Any EntityManager created after the refresh will use any new mappings added to the repository since the previous refresh.
The following link shows an example of how a system as described above could be configured. Please note: The final release date for EclipseLink 2.3 is June 22, 2011 and the examples and documentation will evolve as we get closer to that date. If you would like more detail, please check back after the release date or take advantage of our mailing lists and forums.
http://wiki.eclipse.org/EclipseLink/Examples/JPA/Extensibility
Friday, June 3, 2011
EclipseLink RefCardz Available
A new RefCardz is available from DZone on JPA development with EclipseLink:
http://refcardz.dzone.com/refcardz/eclipselink-jpa
Thanks to Gordon Yorke for his hard work putting this together during the busy months leading up to the EclipseLink 2.3 (Indigo) release.
http://refcardz.dzone.com/refcardz/eclipselink-jpa
Thanks to Gordon Yorke for his hard work putting this together during the busy months leading up to the EclipseLink 2.3 (Indigo) release.
Subscribe to:
Posts (Atom)