• 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

Business logic in PL/SQL?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am designing a 3-tier, web-based intranet application for my client. It's going to be a WebSphere portal app with Struts, running on Oracle 8.1.7.

One of the requirements is to implement the business logic in the back-end (PL/SQL), not in Java (although that is what I'm used to do). The reason probably has something to do with fear of performance issues ("the more code runs in Oracle, the faster") and resource planning ("more people here know Oracle better than Java").

This unusual (?) choice in my humble opinion leaves me with two major issues; how to cache database results and how to perform the O/R mapping.

I know how to use CallableStatements and JDBC, but I'd really like to avoid such a solution now we have EJB 2.1 and Hibernate and everything. And without caching as done by any sensible app server I fear performance issues.

Does anyone know a tool that can perhaps generate Java code and performs the O/R mapping? Or a tool that avoids me having to implement up to a hundred (!) CallableStements and ResultSet-To-JavaBean mappings. I've seen Apache's commons-dbutils that seems to do this.

Does anyone have experience with business logic in PL/SQL and calling procedures from Java? Is performance really an issue here?

Thanks in advance for any input,

regards,
Bram Rooijmans
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bram,
Welcome to JavaRanch!

It isn't necessarily good or bad to put the business logic in a stored procedure. However using "performance" as a reason is premature optimization. We've had plenty of efficient applications using prepared statements with the logic in Java.

If the organization has Oracle expertise and is ok with the tight coupling to the database, it makes sense to keep the logic there. One thing to watch is that there are enough Java people for the rest of the app!

You can still cache database results in Java using a custom cache. If everything is done in the db stored proc, you don't need an O/R mapping. Just call the stored proces and get the results.

The performance depends on what the stored procs do.
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bram,
If you aren't already aware of it, perhaps OrindaBuild will be helpful?

Good Luck,
Avi.
reply
    Bookmark Topic Watch Topic
  • New Topic