Business logic in PL/SQL?

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 (!) CallableStatements and ResultSet-To-JavaBean mappings. I've seen Apache's commons-dbutils that seems to do this.
Does anyone have experience implementing 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

This unusual (?) choice in my humble opinion leaves me
with two major issues; In non-trivial applications excluding all business logic from the database is usually an architecture or design bug. Businesses do use the database directly due to legacy, tools, comfort level, etc. And in those cases the data still needs to be consistent. Not to mention that for some business logic the database can be orders of magnitude faster in running it versus external logic.
On the other hand I would consider it a bug as well if someone told me that all the business logic must be in the database and no where else. (At the very least I would suspect and question their definition of business logic in that case.)
I know how to use CallableStatements and JDBC, but I'd really like to avoid such a solution now...How are you going to implement any non-trivial business logic in oracle without using stored procs?
Does anyone have experience implementing business logic in PL/SQL and
calling procedures from Java? Not sure of the question. Certainly I have implemented business logic in PL/SQL. And many people have used stored procs via java.
Is performance really an issue here?No idea. That is a dependency of your system, not of java/databases in general.
I have seen java only solutions that even with scalling take hours to do operations that could be done in much less time using the database itself.
I have seen requirements which would have taken hours even in the database and changing the requirements meant it took less than 2 minutes. (It had nothing to do with java nor the database.)
I have seen code implementations which took significant database processing time where the entire solution could have been done without the database at all.
I have seen solutions where, due to business requirements, the same business logic was implemented in different languages and in slightly different ways in each. Implementing the logic in stored procs meant that all of the systems that used it now would be using the same rules. In that case it is possible that the solution was actually slower. But if it was it was not noticed and the consistency was much more important.

Similar Messages

  • Future support for using PL/SQL core business logic with ADF BC

    We want to migrate our large Forms client/server (6i) application to ADF, possibly using a migration tool like Ciphersoft Exodus.
    One scenario could be to use ADF BC and ADF-Faces or a different JSF-Implementation for presentation and business layer but keep our heavy PL/SQL-businesslogic inside the Oracle database in packages, triggers, functions and procedures.
    This scenario could be chosen due to the huge amount of interconnected logic inside the database (10 years of development; no technical components; any package may access any table and more of this kind of dependencies). The business logic nowadays held in Forms client will be moved mainly into the database as a prerequisite to this scenario.
    Choosing this "keep-logic-in-DB"-scenario we need a good support by ADF BC to do so. We know and prototyped that it is possible to call some PL/SQL via JDBC from ADF BC and it is possible to use stored procedure calls for standard business entity data access (ins, del, upd, ..). But this does not solve our problems. We want to reuse core business logic coded in PL/SQL. This is much more than change the ADF standard behavior for an update with an own PL/SQL-call.
    Now my question:
    Will there be a kind of sophisticated support to use ADF BC in combination with database-kept logic?
    If so, when will this happen and how will the common problems of transactional state inside the database and inside the ADF BC be solved? Any plans or ideas yet?
    Many other clients do have similar applications built in Forms and PL/SQL and would be glad to hear about a path of direction.
    I've read the technical article 'understanding the ADF BC state management feature' which you have contributed to. One current limitation is pointed out there: Using PL/SQL with ADF BC limits ADF AM pooling to 'restricted level' which reduces scalability.
    Are you aware of additional main problems/tasks to solve when using PL/SQL heavily with ADF BC, which we have to think about?
    Thank you for any response.
    Ingmar

    My main problem is two 'concurrent' areas holding state in an application system based on DB-stored PL/SQL-logic in combination with ADF BC.
    For a new System everything can be made ok:
    Sure, it is possible to build a new system with the business logic included in ADF BC only. All long-living state will be handled in the BC layer ( including support for UnitsOfWork longer than the webside short HTTP-requests and HTTP-sessions and longer than the database transactions.
    For an old system these problems arise:
    1. DB data changes not reflected in BC layer:
    Our PL/SQL-logic changes data in tables without notifying the ADF BC layer (and its cache). To keep the data in ADF BC entity objects identical to the changed database content a synchronization is needed. BC does not know which part of the application data has been changed because it has not initiated the changes through its entity objects. Therefore a full refresh is needed. In a Forms4GL environment the behavior is similar: We do frequently requeries of all relevant (base)tables after calling database stored logic to be sure to get the changed data to display and to operate on it.
    -> Reengineering of the PL/SQL-logic to make the ADF BC layer aware of the changes is a big effort (notifying BC about any change)
    2. longer living database transactions
    Our PL/SQL-logic in some areas makes use of lengthy database transactions. The technical DB-transaction is similar to the UnitOfWork. If we call this existing logic from ADF BC, database state is produced which will not be DB-committed in the same cycle.
    This reduces scalability of ADF BC AM pooling.
    Example:
    a) Call a DB-stored logic to check if some business data is consistent and prepare some data for versioning. This starts a DB-transaction but does not commit it.
    b) Control is handed back to the user interface. Successful result of step a) is displayed
    c) User now executes the versioning operation
    d) Call another DB-stored logic to execute the versioning. DB-transaction is still open
    e) Business layer commits the transaction automatically after successful finishing step d). Otherwise everything from a) to e) is rolled back.
    -> redesign of this behavior (= cutting the 1to1 relation between LogicalUnitOfWork and the technicalDatabaseTransaction is a big effort due to the big amount of code.

  • Oracle ADF Business Components Vs PL/SQL Application

    Hi,
    Has anybody used Oracle Application Development Framework's Business Components (ADF BC)? What are the disadvantages and issues that you faced? Can anyone compare PL/SQL with ADF BC?
    Would like to know the advantages and dis-advantages of both the technologies(PL/SQL and ADF BC).
    Can anybody help on this?

    Hi,
    Not sure what exactly you are looking for.
    But let me explain so that you can get some idea of their working and ofcourse difference.
    ADF BC which are nothing but the Entity Objects (EO) and View Objects (VO) which are the Java representation of the DB.
    EO is like database table and is a 1-o-1 representation of the underline database table as a Java class file.
    VO is like database view and is always based upon some custom SQL or combination of one or more EOs.
    For developing a Database based application you always layer where you can handle the database objects and can also write the business logic or validation for the
    data entered at the UI.
    PLSQL is straight forward is the language to write business logic at the database level.
    I hope this will give you some details.
    Thanks,
    KKCHOPRA

  • ADF11g: business logic in ADF BC or PLSQL?

    Hi All,
    For a new development in ADF 11g , where we should put our business logic: In ADF BC or in PLSQL?
    What if we write all the bussiness logic in plsql? Because if tomorrow ADF goes(which I know is not ging to happen soon), we can expose pl/sql as web services, and new UI technology can use it. And we will not struggle on migration, as we are struggling today from Forms to ADF.That's what my manager says......
    Though I know that we can write our business logic in ADF BC, and that too can be exposed as web service.
    But I still need more suggestion on this, which one is better to write bussiness logic.
    Thanks
    Vikram

    We have a team with mixed skill sets, so consequently some of our business logic is in ADF/BC and some is in PL/SQL.
    Having some in PL/SQL allows my project manager to divide and conquer the work to be done on an adf project easier than I can train the pl/sql guy to be an adf guy...supposedly.
    Also our project manager is also a techy with a primarily pl/sql orientation.
    I like Java better because it is new and fun for me, but that is not much of a reason.
    I have been to many presentation's of Paul Dorsey's BRIM product. Paul is absolutely certain that you and your manager are doing good when you put business logic in the database. Paul goes even further. I respect him and his arguments are sound.
    I still like Java better...mostly because I have done pl/sql for ages and am tired of it. :-)

  • Business Logic Editor with Complex Transasctions

    I'm starting to have some serious problems using the Business Logic Editor with reasonably large (but by no means huge) transactions. These transactions also have nested transaction calls down a few layers. The main symptoms are:
    1)  When opening the Link Editor on the first action it is somewhat sluggish. Opening the Link Editor on the last action can take over 60 seconds.
    2)  If adding a new Transaction Call action, selecting the called transaction in the Configure window doesn't work. The transaction can be selected OK, but the browse window will not close. It has to be cancelled. The Link Editor does not show the transaction's input, even though the Configure window will now show the selected transaction's path OK.
    3)  If the transaction is Saved after 2), that transaction will not open again in the Logic Editor, even after a reboot.
    Memory seems to be part of the formula. The above is on a notebook with 1Gb of RAM. On a dual core with 2 Gb, the problems are less, but not much. On a server with 8Gb, the symptoms disappear.
    Does anyone know if there is a recommended minimum system config for using the Logic Editor?
    What is actually happening when a transaction with nested Transaction Call actions is loaded in the Editor and for exection? I have many transactions that don't have the above problems, but they take a long time to open in the Logic Editor, and up to 1.5 seconds to load when executing the transaction (this is as per the F5 timings).
    Thanks,
    Bill

    Rick,
    These days I'm very careful about large embedded reference docs in my transactions. I actually go through the .trx files with notebook looking for any large chunks of that sort of XML and make sure they are eliminated.
    In the case of this transaction, by the time I get to the actual SQL query action (and remember it's a few layers of nested transaction calls down), it can't run the query anyway. The Query Template name in the configure window is blank. That and any params are set dynamically in Links at run time (the Query Template name actually comes from a config file). If I try Limit Rowcount or Yes when I close the configure window, it just gives an error because it has no idea what query template to run.
    Given this, the problem just doesn't seem related to fetching data. And how would this cause the Links window to take so long to open in the Logic Editor?
    Bill

  • Business Logic in Oracle Applications (General Question)

    Hello everyone!
    I am relatively new to Oracle Apps and interested in learning and joining this community.
    I was trying to figure out how is the Business Logic programmed in E-Business Suite. Is it just PL/SQL or is it BC4J? Is there anyone who could help me answer this question or point me in the right direction (I went through the documentation very quickly (it is rather large so it was only "briefly") and could not find anything that would answer my question exactly)
    By Business Logic I mean business-related tasks such as "enter a journal entry" or "issue sales order" (with a higher or lower level of granularity of course)
    Any help is much appreciated !

    Just to expand on Bala's answer, it depends on how your application is architected.
    If you have a Forms based application, then your Business Logic (BL) resides in PLSQL. The forms tier performs the basic validation and partial BL execution and passes the data to the handlers in the database to perform the DMLs and initiate required Business Process.
    If you have a OA Fwk based application, then your BL could reside either in BC4J or PLSQL. There are OA Fwk applications that are written that performs some business logic execution within the middle tier and passes the rest to underlying PLSQL code. Take for example an application that was originally written in Forms but later on extended or migrated to OA Fwk. Since most of the BL was already written in PLSQL and some of the forms would still be using the same PLSQL APIs, it essential that the OA Fwk based application too uses those APIs to be in synch.
    If you are designing a new application to be based on OA Fwk, it is strongly recommended that you go with your BL as much as on the middle tier.
    So it all depends... :)
    Thanks
    Vijay

  • Does Jheadstart retain Business logic after migrate from form9i

    Hi
    I wish to do convertion from oracle form9i into Jheadstart
    MVC framework, I knew from doc, business logic can be emmbebed inside the Bc4j entities manually, but how far does jHradstart able to retain the original business logic inside those 9iforms if i would like to do convertion thru reading designer repository which i build from a reverse engineer process.
    please advice
    Keatmin

    Dear Ramana,
    The functionality you are looking for is called Design Capture (Forms definitions into the Designer Repository). This functionality can be found in the Oracle Designer tool Design Editor.
    Design Capture reads the Form definitions (fmb files) and creates Module Definitions in Oracle Designer. The module definitions contain Module Components, Items and the links to tables and columns. PL/SQL code in the Form is design captured as Application Logic into Designer.
    The JHeadstart Designer Generator will read the Module, Module Component, List of Values and Item definitions from Designer to migrate to a JHeadstart Application in JDeveloper.
    You do not access Forms directly from JDeveloper.
    best regards,
    Lucas Jellema

  • Business Logic in ETL process of Oracle_BI_DW_Base.rep

    Hi,
    Are there any docs or web pages that convey business logic used in informatica mappings used for Order Management ?
    Ex: SIL_SalesOrderLinesFact
    Do we need to open every transformation in it and see the query or sql overrides to acquire business logic ? Or Oracle gives any standard docs on this ?
    Thanks,

    Short answer is no. There is no Oracle document that gives the "business logic" for all the ETL mappings. It would be wonderful if that existed. The best approach is to dig into the mappings and try to understand the flow. Using the DAC and Informatica, along with the DMR (data model reference), you can formulate the general strategy that Oracle uses. Some of the mappings/mapplets/transformations also have some comments. What you will see is that Oracle uses similar strategies across the stack. For instance, the method to do SCD Type 2 changes, or to do Aggregation..or to lookup to get the proper WIDs...its similar across all the OBIA apps.

  • Logical Operations in SQL decode function ?

    Hi,
    Is it possible to do Logical Operations in SQL decode function
    like
    '>'
    '<'
    '>='
    '<='
    '<>'
    not in
    in
    not null
    is null
    eg...
    select col1 ,order_by,decode ( col1 , > 10 , 0 , 1)
    from tab;
    select col1 ,order_by,decode ( col1 , <> 10 , 0 , 1)
    from tab;
    select col1 ,order_by,decode ( col1 , not in (10,11,12) , 0 , 1)
    from tab;
    select col1 ,order_by,decode ( col1 ,is null , 0 , 1)
    from tab;
    Regards,
    infan
    Edited by: user780731 on Apr 30, 2009 12:07 AM
    Edited by: user780731 on Apr 30, 2009 12:07 AM
    Edited by: user780731 on Apr 30, 2009 12:08 AM
    Edited by: user780731 on Apr 30, 2009 12:08 AM
    Edited by: user780731 on Apr 30, 2009 12:09 AM

    example:
    select col1 ,order_by,case when col1 > 10 then 0 else 1 end
    from tab;
    select col1 ,order_by,case when col1 &lt;&gt; 10 then 0 else 1 end
    from tab;
    select col1 ,order_by,case when col1 not in (10,11,12) then 0 else 1 end
    from tab;As for testing for null, decode handles that by default anyway so you can have decode or case easily..
    select col1 ,order_by,decode (col1, null , 0 , 1)
    from tab;
    select col1 ,order_by,case when col1 is null then 0 else 1 end
    from tab;

  • Can we use WHO columns in Business Logic implementation

    Hi,
    Can we use WHO columns for business logic implementation..?
    From one table I need to pick up the latest record. I have a ActionDate column in the table which stores the date of the action.
    But on the same day there can be multiple action records. ie Multiple records have same ActionDate.
    Select * from action_table where action_date=(maximum action_date)
    The above query will return more than 1 record.
    Now can I use the Creation_Date which is a WHO column to identify the latest record..?
    Will it introduce any issues if I use creation_date WHO column?
    Usage of WHO column in application logic, Is it against the Standards ?
    Thanks a lot.

    I guess you are talking about populating the value using the history column creation_dt from EO.
    If so, you can use then. We are using them in all our applications to populate WHO columns of our table.
    Infact as far as I know, even Oracle application uses them.
    They generally populate the timestamp, so you may need to format them when doing date comparisons.
    Hope that helps.
    Amit

  • Problem in creating a callable object of type Business Logic

    Hi SDN,
    I am trying to create a callable object of type Business Logic in CE.
    When I give all information and click Next, I get this error message.
    Error while loading configuration dialog: Failed to create delegate for component com.sap.caf.eu.gp.ui.co.CExpConfig. (Hint: Is the corresponding DC deployed correctly? Does the DC contain the component?)
    Can anybody help me out with this problem.
    Regards,
    Sumangala

    Hi.
    I'm having the same problem as Senthil in NW2004s SP15 with my application service and methods not showing up in the Callable Object wizard for Composite Application Services after I choose the Endpoint.  The only application name that shows up in the wizard is caf.tc, and the only service names that show up for it are LDDataAccessor, Metadata, and PropPermissionService.
    My IDE is on one machine and the application server I deploy to is located on a different machine.  My endpoint to the remote application server looks to be correctly configured.  The Composite Application Service seems to be deployed properly as I'm able to see it and test that it works in the Web Services Navigator <http://remotehost:50000/wsnavigator/>
    My deployed application service is a remote enabled service and is also web services enabled as well.
    I'm not sure if this is relevant, but I noticed that the generated Java code does not create any remote EJB interfaces (only home and local interfaces were generated).
    Something else I noticed is that when I proceed to the External Service Configuration -> Business Entities screen <http://remotehost:50000/webdynpro/dispatcher/sap.com/cafUIconfiguration>, I only see three business entities displayed, and the following error message is displayed: "Corrupt metadata has been detected. This may prevent some objects from being displayed. Check the server log for more details."  I was unable to find anything in the instance log files.  Is the error message indicative of the problem?
    I am developing locally without a NetWeaver Development Infrastructure (NWDI) in place.
    I'm wondering if the credentials specified in the endpoint require any special roles or privileges.
    Senthil, do any of these additional descriptions apply to you as well?
    Edited by: Ric Leeds on Jun 20, 2008 4:37 PM

  • Problem with Business Logic Services Logic Editor

    Hi,
    I am trying to go to Logic Editor under Business Logic Services. I'm getting error that "Unable to launch xMII"
    Is there any java related problem in my machine?
    Regards,
    Amalesh

    Amalesh,
    What version of xMII are you using 12.0 by chance.  If so goto the Java Web Start -> File -> Preferences -> and set your proxy to "None".  I would not recommend reinstalling Java as this will not solve your problem and if you are on xMII 12.0, the recommended version is 1.4.2_13 as a minimum.
    Regards,
    Erik

  • How To Set the Resultstate of Business Logic CO for Loop Decision Action

    Hi,
    I'm using a pre-conditional loop block in my GP process and using a Business Logic CO for the loop decision action. My expectation is the business logic CO should be executed at background and based on its resultstate the loop flow will happen. I've 2 resultstates in the loop decision (bus logic CO) - Continue and Break. I'm setting these two resultstates in the following way :
    Continue : BOOL(@currentLevel < @totalLevel)
    Break : !BOOL(@currentLevel < @totalLevel)
    currentLevel and totalLevel are the two input parameters (unsigned int type) of the business logic CO. If I test the CO it works fine and displays the correct resultstate. But at runtime the process gets paused at the loop decision action CO. I see the loop decision action link in my GP workcenter and UWL and on clicking of it nothing happens. If I refresh the screen still it's there as before.
    Anybody who can throw any light on this issue will be highly appreciated. And reward points guranteed for any help to solve the issue
    Thanks in advance,
    Dipankar

    Hi,
    Well I solved this issue myself ! After lot of research I found out that the resultstates should be in all small case <b>continue</b> and <b>break</b> and NOT Continue or Break.
    But now I've a different issue:
    I've an initial action under a sequential block. Then the pre-conditional loop block with a loop decision action and a loop body block(seq block).
    The expectation is initially the decision action should get the output param passed by the initial action and then in the iterations it will get the values passed by the output params of the loop body action. To achieve that I have mapped the output param of the initial action to the input param of the decision action and the input and output param of the loop body action. But it seems that the loop decision action though mapped to both the output of the initial action and the loop body action takes the value only from the initial action over the iterations and the values from the loop body action are not getting passed to the loop decision action. The context parameter value of the loop decision action remains static and it becomes an infinite loop.
    Any help to resolve this issue will be highly appreciated.
    Thanks,
    Dipankar

  • How to Display Multiple Rows in Business Logic Editor

    Hi Friends, I took the standard BAPI:   BAPI_MATERIAL_GETLIST and followed the SAP- xMII documentation. It is not showing any records. Does any one have good example. Please let me know.
    If I run the same BAPI from R3 system, it is showing 7 records.
    Can I display the data in Business Logic editor? Please help.

    Hi Dilip
              I have gone through your post and I think that the info provided by yu is not sufficent to answer yur question exactly but i would suggest yu the following solutions :-
    1. It may be the case that yu are not looping on the Response XML from the BAPI. You need to loop on the repeating node of the Response XML of the BAPI and on each loop yu need to append the record read to a xMII Output XML document using Row structure. Finally Yu can assign the document to the Output variable.
    2. Check for the type of Output Variable. I guess that it's String type. In that case, convert it to xml type.
    Hope it helps.
    Amit

  • BPEL Process with complex Business logic

    Hi,
    So far my knowledge,complex business logic can be implemented by different way in bpel process.
    1. Business rule
    2. ejb with java callout
    3.ADF BC as servcie
    Can anybody please suggest which approach do I need to follow,what are the pros and cons of each one,and best practices to use when and where?
    Thanx in advance.-Aswini

    Hi
    In addition to what Naresh already mentioned, you can consider these points also.
    1. If your process is complex, see if some part of the process can be common across and it can run by itself. Then you can use SubProcess concepts also. Say for example, if process involves credit card processing, it can be in a sub-process and you can call it in the main process. Like that any common approval flows can be put in a separate sub-process.
    2. I would discourage using Java invocations if possible as they have some limitations and you can use reasonable amout of code in invoking java code within the bpel process. If you have lots of validations to do on a bpel process, you can consider using CallBackHandlers and do the validation on a task assignment, submission or any task action in general.
    3. Business Rules can be used to control the actual flow of the process itself. Based on busiiness rule, you can decide if a set of tasks needs to be included or not in the approval flow. This is in addtion to the actual data that controls the business rules, that can be changed dynamically without the code change to core bpel process.
    Which version of SOA are you using or plan to use. I would recommend the latest version SOA 11.5 + Feature Pack applied.

Maybe you are looking for

  • What adapter do I need for my iPhone 4?

    I have a charger that has stopped working two days ago (the cable to be exact) and would like to know what adapter would work for this. I have an iPhone 5 which is a company phone and I have the new lightening cable that comes with it. Is there an ad

  • Invoice getting sorted automatically in MIRO

    Hi , Can some one please hep in resolving the issue: While posting the freight invoice in MIRO, orders are entered in the order of shipping invoice i.e. its not sorted. When i enter values randomly in 'Multiple selection' one by one and execute, than

  • Handling query errors when using ADO connection in MSAccess

    Hello, I'm working on enhancing a data pull from a terrabyte sized Oracle database for use within an MSAccess front end. The current plan is to append and update tables within Oracle using ODBC pass through queries or ADO connection objects, then cop

  • How to find my apps ?

    hello everybody i have a problem with my iphone i have iphone 3gs okay and i connected to my laptop ( macbook pro ). then i did the update . later all my apps have been gone i dont know where they are ? can any one help me out !!! thank you very much

  • Twain acquire within Illustrator

    TWAIN, I have requested this feature for every update since Illustrator 10 and before. It would be so convenient to load images and vectors without having to go to other programs like Photoshop and draw. Easy curve tool - had one of those since Creat