How Can jBilling Help You?
Who’s Using jBilling?

“I can certainly recommend jBilling.”
Kevin Nelson
Web Conferencing Central
See all testimonials >

AVAILABLE - Convert entity beans to JPA - Phase 1

Current functionality:
The database access is done with a mix of entity beans (part of the EJB 2.1 specification) and direct JDBC queries.

Desired functionality:
All the database access should be done using Hibernate JPA.

Technical overview:
Entity beans have a big problem: locks are spread around like wild file, even for read only queries. This is a big problem for scalability and concurrent access. We want to take the 80+ entity beans and migrate them all to JPA. Some have been migrated already, we will use those migrations as a template on how to migrate the rest.

Server tier modifications:
We will start with the following groups of tables:
Group A:
JBILLING_TABLE
JBILLING_TABLE_COLUMN
COUNTRY

Group B:
CONTACT
CONTACT_FIELD
CONTACT_FIELD_TYPE
CONTACT_MAP
CONTACT_TYPE

Group C:
LIST
LIST_ENTITY
LIST_FIELD
LIST_FIELD_ENTITY

Group D:
REPORT
REPORT_FIELD
REPORT_TYPE
REPORT_USER

You can pick any group you want that hasn't be taken, the four of them can be worked on at the same time.

The DTO objects, now generated by xdoclet from the entity beans, will now actually replace the entity beans.
The 'DTOEx' objects will disappear.
A new object 'Data Access Service' will be needed to handle queries. This class has to extend the AbstractDAS class.
Transaction boundries are now done programmatically, see the class PluggableTaskSessionBean for an example.

Take a look to this package for an example:
http://jbilling.svn.sourceforge.net/viewvc/jbilling/trunk/classes/com/sapienter/jbilling/server/pluggableTask/admin/

The following commit was done when a few entity beans were migrated to JPA. These were the 'pluggable task' group of beans, reviewing some of the new files or changes can be of help:
http://jbilling.svn.sourceforge.net/viewvc/jbilling?view=rev&revision=250

Client tier modifications:
Usually, there is not much to change on the client. The struts actions and JSPs are already using DTO, but some times small changes are needed.

Database tier modifications:
Each table migrated needs to add the 'OPTLOCK' column for optimistic locking. See the pluggable task tables for examples.

 
dolson wrote 2 years 10 weeks ago

I believe that this item is no longer available

I have looked at many of the entities listed above and they appear to have been converted.

Daryl O.

Please register or login to post a comment.