Search This Blog

Friday, February 5, 2010

02-04-2010

How can we make BASS enterprise quality?  Here are some initial thoughts:

  • distribute Quartz to all BASS instances via Terracotta
  • put a UI in front of BASS to help with start/stop/resubmitting of jobs (Spring MVC?)
  • use Terracotta Master-Worker to load balance running of jobs
  • see if Spring Integration makes it easier to get at some of the resources that the Spring Batch jobs will be accessing
Just posted to the Terracotta forum asking if the detached Hibernate session strategy is flawed.  If Ben is correct that not having transactions wrapped around an update can propogate bad state, then I think the technique is unusable.  Is there a Spring transaction trick we can play where we wrap a psuedo-transaction around the updates?  Maybe working on a copy of the detached object until the transaction commits?  Sounds doable but copying a deep object graph sounds cumbersom and then there is the question about how does that affect the proxying that Hibernate does under the covers?  After doing some reading in the Hibernate book I ran into another interesting scenario.  If an object has been marked for deletion, it is still in the Hibernate session but hasn't been actually removed yet.  Is that another case of sharing is bad?  I'd be working on an assumption that something is still "alive" but it really about to go away.

A Business Key is a property, or some combination of properties, that is unique for each instance with the same database identity.  It is probably the natural key you would've chosen if you hadn't been smart  used a synthetic surrogate primary key.  A combination of first, middle and last name, perhaps?  Maybe every property minus the primary key (never add in the collections).  Each object should have a business key and should implement its equals/hashcode methods in terms of the business key.  They business key should rarely change. Important: always compare property values via getters and not directly property access.  Hibernate uses proxies and these get skipped if you use direct access.

No comments:

Post a Comment