• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Data Integrity - Batch Programs in Weblogic 6.1

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,
For a particular J2EE application, we have a lot of online transactions for Inserting/Updating/Deleting records in Oracle 8i DB.
The records inserted/deleted/updated becomes Input for many BATCH java programs.
This is (24*7) Internet/Intranet application.
If at a given point of time, there are users who do Updates to Oracle datbase (Insert/Update/Delete) by using online screens and if parallelly we have many batch Java programs running, how is it possible to maintain data integrity/consitency.
Is there any Weblogic feature that can be used so that it uses a sort of Database Cache etc for a particular period of time so that online and batch jobs are not affected.
I'd like to know any feature specific to Weblogic rather than using 3rd party solutions like Tangosol convergence.
Thanks,
Suresh Selvaraj
 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Most of your data integrety issues should be resolved by proper use of Transactions.
Make sure that your updates are Transactional.
The easiest way to do this is put the JDBC work in an EJB and set the transaction-attribute in the ejb-jar.xml.
Check your setting for Isolation Level (in the weblogic-ejb-jar.xml. If it is, for example, READ_COMMITED, then your reads will not see uncommited (partial) data from the updates.
I don't suggest using SERIALIZABLE with Oracle as it does not actually serialize, but uses optimistic locking - you'll get rollbacks and exceptions if you have concurrent users updating the same data.
For the reads, you have a couple of choices. You can do a database call everytime you need a piece of data. This could give you different answers for the same data item (or incinsistent results for related items) if an update happens between the two reads.
Another way to go is to do one bulk (transactional) read at the beginning of the servlet or at the beginning of the user's session. Get all the data you might need and shove it into the HTTP session. You won't see intermediate updates, but all the data will be consistent.
The right answer is probably somewhere in the middle of these two, and depends on the application (and, as always, involves making compromises between development effort, concurency, load, user experience, likelyhood of problems, etc).
If you put your database access behind Entity Beans using CMP, then WLS will let you configure lots of caching options, so you can go thru the entities without having to implement database caching of your own.
 
Dave Landers
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oops - just saw the 6.1 version in your subject line. Note that the CMP entity caching applies only to EJB 2.0 version CMP - you might have to download the ejb20 extensions. And the caching features are getting better every release - 7.0 is better than 6.1 in this regard.
 
Suresh Selvaraj
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dave,
Thanks very much for your input.
Regards,
Suresh Selvaraj
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic