Where to put the logic!

Hello everybody!
I have a big doubt and so does my CIO.
I'd like to develop Web Services using the facade pattern (Entity + Session). I prefer to put the business logic into the stateless EJB and just go to the database to insert, update or delete records.
But the boss says it would be better just to develop a pl SQL (Oracle) that has all the business logic into it and just make the call from the Stateless.
Is there a general approach? What do you recommend?
Thank you very much!

Hi,
in my experience it is better to put the logic in the bean itself.Because if we want to change the database later, it would be very easier.

Similar Messages

  • Where to put the commit in the FORALL BULK COLLECT LOOP

    Hi,
    Have the following LOOP code using FORALL and bulk collect, but didnt know where to put the
    'commit' :
    open f_viewed;
    LOOP
    fetch f_viewed bulk collect into f_viewed_rec LIMIT 2000;
    forall i in 1..f_viewed_rec.count
    insert into jwoodman.jw_job_history_112300
    values f_viewed_rec(i);
    --commit; [Can I put this 'commit' here? - Jenny]
    EXIT when f_viewed%NOTFOUND;
    END LOOP;
    commit;
    Thanks,
    - Jenny

    mc**** wrote:
    Bulk collect normally used with large data sets. If you have less dataset such as 1000-2000 records then you canot get such a performance improvent using bulk collect.(Please see oracle documents for this)
    When you update records Oracle acquire exclusive lock for that. So if you use commit inside the loop then it will process number of records defined by limit parameter at ones and then commit those changes.
    That will release all locks acquired by Oracle and also teh memory used to keep those uncommited transactions.
    If you use commit outside the loop,
    Just assume that you insert 100,000 records, all those records will store in oracle memory and it will affect all other users performance as well.
    Further more if you update 100,000 records then it will hold exclusive lock for all 100,000 records addtion to the usage of the oracle memory.
    I am using this for telco application which we process over 30 million complex records (one row has 234 columns).
    When we work with large data sets we do not depends with the oracle basic rollback function. because when you keep records without commit itb uses oracle memory and badly slowdown all other processes.Hi mc****,
    What a load of dangerous and inaccurate rubbish to be telling a new Oracle developer. Commit processing should be driven by the logical unit of a transaction. This should hold true whether that transaction involves a few rows or millions. If, and only if, the transaction is so large that it affects the size constraints of the database resources, in particular, rollback or redo space, then you can consider breaking that transaction up to smaller transactions.
    Why is frequent committing undesirable I hear you ask?
    First of all it is hugely wasteful of rollback or redo space. This is because while the database is capable of locking at a row level, redo is written at a block level, which means that if you update, delete or insert a million rows and commit after each individual statement, then that is a million blocks that need to go into redo. As many of these rows will be in the same block, if you instead do these as one transaction, then the same block in redo can be transacted upon, making the operation more efficient. True, locks will be held for longer, but if this is new data being done in batches then users will rarely be inconvenienced. If locking is a problem then I would suggest that you should be looking at how you are doing your processing.
    Secondly, committing brings into play one of the major serialization points in the database, log sync. When a transaction is committed, the log buffer needs to be written to disc. This occurs serially for multiple commits. Each commit has to wait until the commit before has completed. This becomes even more of a bottleneck if you are using Data Guard in SYNC mode, as the commit cycle does not complete until the remote log is notified as written.
    This then brings us two rules of thumb that will always lead a developer in the right direction.
    1. Commit as infrequently as possible, usually at the logical unit of a transaction
    2. When building transactions, first of all seek to do it using straight SQL (CTAS, insert select, update where etc). If this can't be easily achieved, then use PL/SQL bulk operations.
    Regards
    Andre

  • I changed my iPhone lately but i can't restore my last backup since it keeps saying "itunes could not restore backup because the password was incorrect" but I don't know where to put the password to make it happen... Any suggestions?

    Hey guys,
    I just bought a new iPhone but i can't restore my backup files beacuse it keeps saying "itunes could not restore backup because the password was incorrect" but I really don't know where to put the password to restore it. I really have some files that are meaningful for me so I really need help. Any suggestions anyone?

    Select your iDevice in the iTunes.
    Choose the Summary screen (tab) and scroll to the bottom of the screen.
    Then un-select Encrypt iPhone backup.
    iTunes will then prompt you to “Enter the password to unlock your iPhone backup”, enter the password you set originally.

  • Architecture question...where to put the code

    Newbie here, so please be gentle and explicit (no detail is
    too much to give or insulting to me).
    I'm hoping one of you architecture/design gurus can help me
    with this. I am trying to use good principals of design and not
    have code scattered all over the place and also use OO as much as
    possible. Therefore I would appreciate very much some advice on
    best practices/good design for the following situation.
    On my main timeline I have a frame where I instantiate all my
    objects. These objects refer to movieClips and textFields etc. that
    are on a content frame on that timeline. I have all the
    instantiation code in a function called initialize() which I call
    from the content frame. All this works just fine. One of the
    objects on the content frame is a movieClip which I allow the user
    to go forward and backward in using some navigation controls.
    Again, the object that manages all that is instantiated on the main
    timeline in the initialize() function and works fine too. So here's
    my question. I would like to add some interactive objects on some
    of the frames of the movieClip I allow the user to navigate forward
    and backward in (lets call it NavClip) . For example on frame 1 I
    might have a button, on frame 2 and 3 nothing, on frame 4 maybe a
    clip I allow the user to drag around etc. So I thought I would add
    a layer to NavClip where I will have key frames and put the various
    interactive assets on the appropriate key frames. So now I don't
    know where to put the code that instantiates these objects (i.e.
    the objects that know how to deal with the events and such for each
    of these interactive assets). I tried putting the code on my main
    timeline, but realized that I can't address the interactive assets
    until the NavClip is on the frame that holds the particular asset.
    I'm trying not to sprinkle code all over the place, so what do I
    do? I thought I might be able to address the assets by just
    providing a name for the asset and not a reference to the asset
    itself, and then address the asset that way (i.e.
    NavClip["interactive_mc"] instead of NavClip.interactive_mc), but
    then I thought that's not good since I think there is no type
    checking when you use the NavClip["interactive_mc"] form.
    I hope I'm not being too dim a bulb on this and have missed
    something really obvious. Thanks in advance to anyone who can help
    me use a best practice.

    1. First of all, the code should be:
    var myDraggable:Draggable=new Draggable(myClip_mc);
    myDraggable.initDrag();
    Where initDrag() is defined in the Draggable class. When you
    start coding functions on the timeline... that's asking for
    problems.
    >>Do I wind up with another object each time this
    function is called
    Well, no, but. That would totally depend on the code in the
    (Draggable) class. Let's say you would have a private static var
    counter (private static, so a class property instead of an instance
    property) and you would increment that counter using a
    setInterval(). The second time you enter the frame and create a new
    Draggable object... the counter starts at the last value of the
    'old' object. So, you don't get another object with your function
    literal but you still end up with a faulty program. And the same
    goes for listener objects that are not removed, tweens that are
    running and so on.
    The destroy() method in a custom class (=object, I can't
    stress that enough...) needs to do the cleanup, removing anything
    you don't need anymore.
    2. if myDraggable != undefined
    You shouldn't be using that, period. If you don't need the
    asset anymore, delete it using the destroy() method. Again, if you
    want to make sure only one instance of a custom object is alive,
    use the Singleton design pattern. To elaborate on inheritance:
    define the Draggable class (class Draggable extends MovieClip) and
    connect it to the myClip_mc using the linkage identifier in the
    library). In the Draggable class you can define a function unOnLoad
    (an event fired when myClip_mc is removed using
    myClip_mc.removeMovieClip()...) and do the cleanup there.
    3. A destroy() method performs a cleanup of any assets we
    don't need anymore to make sure we don't end up with all kinds of
    stuff hanging around in the memory. When you extend the MovieClip
    Class you can (additionally) use the onUnLoad event. And with the
    code you posted, no it wouldn't delete the myClip_mc unless you
    program it to do so.

  • I wanted to know explain my problem down package cc2014 where I put the serial number of the problem that I have is that when you open the program asks me start of session in which he put it and go but back inside and it drives me to request the start of

    I wanted to know explain my problem down package cc2014 where I put the serial number of the problem that I have is that when you open the program asks me start of session in which he put it and go but back inside and it drives me to request the start of session and I take 3 weeks or more with this problem if they can support me solve it was the number of seire wearing this being installed at a private university

    Cloud programs do not use serial numbers... you log in to your paid Cloud account to download & install & activate... you MAY need to log out of the Cloud and restart your computer and log back in to the Cloud for things to work
    Some general information for a Cloud subscription
    Log out of your Cloud account... Restart your computer... Log in to your paid Cloud account
    -Sign in help http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sign-faq.html
    -http://helpx.adobe.com/creative-cloud/kb/sign-in-out-creative-cloud-desktop-app.html
    -http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html
    -http://helpx.adobe.com/creative-suite/kb/trial--1-launch.html
    Does your Cloud subscription properly show on your account page?
    If you have more than one email, are you sure you are using the correct Adobe ID?
    https://www.adobe.com/account.html for subscriptions on your Adobe page

  • Hello there, am new here and very stressed, i have an Imac core i3 which is logging off itself after a few seconds of login, it goes back to the login menu where i put the password. I have tried to repair the os but my pioneer rom is not reading the disk.

    Hello there, am new here and very stressed, i have an Imac core i3 which is logging off itself after a few seconds of login, it goes back to the login menu where i put the password. I have tried to repair the os but my pioneer rom is not reading the disk. I press the :c" button on startup but its not picking up the disk in the rom, i have tried to put the disk in an external rom but same answer, am starting to think that my os disk is bad. Please help me.

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of this exercise is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login. Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode* and log in to the account with the problem. The instructions provided by Apple are as follows:
    Be sure your Mac is shut down.
    Press the power button.
    Immediately after you hear the startup tone, hold the Shift key. The Shift key should be held as soon as possible after the startup tone, but not before the tone.
    Release the Shift key when you see the gray Apple icon and the progress indicator (looks like a spinning gear).
    *Note: If FileVault is enabled under Mac OS X 10.7 or later, or if a firmware password is set, you can’t boot in safe mode.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on certain Macs.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem(s)?
    After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • Where to put the sql

    Hi,
    When I develop a Java software which gets data from the user (for example a Web page) and use them for performing and put the result into the database, according to you is it almost always smarter calling an Oracle stored procedure or a package making the task or can it be usefull to put the logics-sql inside the Java code? For me it's always better to develop a strored procedure to be called, but I'd like to listen to your experience.
    Thanks!

    If the Java code is to run against a variety of different database products, then it is limited to the lowest common denominator between these products - the basic SQL language.
    And unfortunately, such code will use the various database products non-optimally. SQL language implementations differ. Analytical SQL functions available in one product will be different or even non-existent in another.
    But in this case, the Java code has little choice - and need to use bare bones SQL.
    Usually this is only a problem for ISVs that are developing commercial client products. For most others, we have a single database product as the strategic product for the selected IT architecture.
    So in this case it makes sense to use and leverage all the features of that database products. Enabling the Java code to optimally use the database. Enable the database to perform and scale.
    In the case of Oracle, that typically means not having Java developers code SQL at all. Not because they are SQL/Oracle idiots (which can be argued). But because of providing a formal and abstract data interface allows far greater flexibility, maintainability and usability.
    It enables you to to deal with SQL and SQL related performance inside this interface, without having to touch and recompile a single byte of Java client code.
    It enables you to deal with database structure changes via this interface, without having to touch and recompile a single byte of Java client code.
    So it makes a LOT of sense to create and use such an interface - not just for Java clients, but all clients. Allowing all clients to share the same interface and be subject to the same validation and business rules in a coherent and consistent fashion.
    In Oracle, this interface will be written using PL/SQL packages - and will typically return ref cursors to the clients.

  • Where to put the Transform.xsl File

    Good evening!
    I am trying to execute a bpel:doXslTransform(xslURI,$a) and i dont know where to put the transform.xsl file for this operation.
    Can anybody tell me?
    Greetz,
    RaRu

    It needs to be in the same folder as the .bpel process - the bpel folder of your project.
    Hope this helps,
    Shanmuhanathan Thiagaraja

  • Where to put validation logic...

    Hi,
    We have a lot of validation logic in our database. Next to the normal foreign key, check, unique constraints, we use triggers for validation (which throw errors with custom error codes when needed).
    On top of the database we are building a fairly large JClient based application using the BC4J framework. BC4J offers the possibility to use validation beans for validating the entity row. We are wondering if we should use this. If we implement the validation logic for each entity we are actually duplicating the validation logic that's already available in the database. And some database constraints are easily implemented using the standard validation beans (like not null and unique checks), but more complex validation rules can sometimes only be done in the database (so we need to use the database for validation using a method validation bean).
    Like I said this means a lot of duplicating validation logic. Which first of all is an inefficient thing to do. Second validation logic can change over time, which means we need to change the logic on two places. It's easy to forget to change the logic on one place.
    We found a way to somewhat use the database validation logic for validating entity rows. We just simple insert a row in the database and post the changes. If the new row contains an error an exception is thrown. This JBO exception contains a reference to the SQL exception. Which can be used to retrieve the database error code. Unfortunately we have not found a good way (yet) to find out where the error occured (in which trigger for example). Error codes don't have to be unique so it's important to know in which context they occured. Another problem with this method is we can't do an early validate on a limitted set of row data. E.g. we sometimes use wizards in our application for adding new rows. We really want to check the data after each step in the wizard (step by step). This is ofcourse impossible with the database logic. This means we again need to create the same validation logic again. I don't think it's even possible to use the row.validate() method for this (and ofcourse implement the validation logic in the entity too), because this method validates the complete row.
    In short, where is the best way to put validation logic? And (how) can this be done without duplicating (to much) logic?
    Regards,
    Peter
    P.S.
    Does anyone know how to retrieve the context of an SQL exception?

    Do you users have access to the data/tables outside
    of using your application? (as in using sqlplus?)Not at the moment.
    Ideally the database should just be going
    constraint--data integrity type of checks. The
    business rules would be in the business layer not
    persitance layer..So in this case, they would be in
    the bc4j entity objects.. Well most of them are simple integrity constraints, but sometimes we have to check things using triggers which are way more complicated and need extensive database access. It's more logical to do that in the database. If the trigger runs into a problem it raises an application error. We are hoping we can use this error somehow in our application.
    That assumes that the only way a user can modify that
    data is through your application only.Well it is, and if another application is written for it the BC4J entities etc. will probably be re-used, but like I said there are other reasons for not having all the business-rules in the BC4J layer.
    by the way, are you migrating an existing application
    that already has all the business rules in the
    database?No, it's a brand new application, but we started out with defining a lot of business rules in the database because that seems a more logical place to put them (to us). I understand that some business-rules can better be implemented in the BC4J entities, but it's not that easy for every business rule we have.
    Regards,
    Peter

  • In HELLO Where doI put the email address of a contact.

    I must be very stupid (admitted) but I cannot get Hello to work for me. Where do I put the email adddress of a person I wish to contcact.

    Hi Brad,
    I really appreciate your taking the effort to help - I must be the greatest of idiots or someting is wrong with my system. I click on the Hello button at the top of my screen and this brings up a panel stating "conversation 1" and below that "Start a conversation" in a blue box. I cannot see the two tabs you refer to "one for chat and other for contacts."
    Unfortunately I am going away for a few days and will not be able to respond, but certainly will when I return.
    Thank you for your interest.

  • JNI where to put the jnilib?

    I have a smal calculating code, and need it fast done, therefore I will use the JNI.
    On MacOSX there is no problem doing this with a dylib, compile the dylib, compile the jnilib put them in the Bundle .. ready to deploy. Easyly done.
    On WIN I get a messsage of unknownsource in the ClassLoader., Runtime. and System. loadlibrary(blah)
    Where do I have to put the blah.jnilib and the dll to get the applikation used of them??
    Must the library path set to get the compiled jnilib run on WIN?? Where do i have to set the path for the jnilib and the dll? DLL in system 32 I guess but where the jnilib???
    Or should i just name the prefix of blah when compiling .dll instead of .jnilib, but then I need to manage the file using on different platforms isn�t so??
    thanks for help

    Windows will find the DLL if it is listed in the PATH environment variable. On Windows XP, I click Start / Control Panel / System / Advanced / Environment Variables. I can then edit the path string which is a semicolon-separated path list.
    If you do not want to mess around with the environment variables, you can allways do it M$-style and squeeze the DLL into c:\windows\system32 amongst the other couple hundreds of DLL's already there.

  • Where to put the url endpoint for changing between enviroments?

    Hello,
    I have created a few jax-ws clients. I am now in development stage, but in the future I will want to put them in preproduction enviroment. where is the best place to put the service urls for calling it and changing in an easy way?
    I came from dot net world, I am used to a web.config file which I can change in hot, does java have something like that?
    Thanks in advance.

    If you are using Spring then these will be helpful to you-
    [http://blog.vinodsingh.com/2008/11/environment-specific-property-with.html|http://blog.vinodsingh.com/2008/11/environment-specific-property-with.html]
    [http://blog.vinodsingh.com/2008/05/webservice-endpoint.html|http://blog.vinodsingh.com/2008/05/webservice-endpoint.html]
    if not then you can devise some thing similar.

  • Where to put the patches ????

    Hi All,
    I have a question about where to keep the patches on weblogic6.1+sp2.
    what is the best practice/way to put the patches on wls6.1/wls8.1 .....iam more or less interested on putting these patches on wls6.1+sp2
    say for some reason, i need 4 patches(which are related to the same problem) ....and i downloaded it from support.bea.com site ...and then ......what is the best practice to place them....where ??
    We have been keeping the 4 patches(or all of them) at CLASSPATH level....but i don't know if it could be a issue for HOT DEPLOYMENT or not ....OR some other issues ?
    please let me know what is the BEST practice and other practices of keeping these patches ????
    thanks alot.
    -sangita

    I put patches on the knees of my denim overalls. I also like to wear a straw hat and carry around a pitchfork. It makes me look like a hick, but people better respect me or I will spear them with my pitchfork!

  • Where to put the GIF/JPG files so they show up in Forms Developer

    Hi:
    This refers to Forms 10gR2; Forms Builder running on Windows XP......
    Where do I put the GIF and JPG files referenced by the "iconic filename" property so that they show up in Forms Builder? By placing them in the jar file, I can get them to appear at runtime, but NOT in development!
    I have tried putting the files in the same directory as the FMB, as well as in C:\DevSuiteHome_10g\forms\java (where the image jar file resides).
    In each case, I have included the path in the FORMS_PATH environment variables.
    Thanks

    Hi,
    For design time, you need to use the UI_ICON and UI_ICON_EXTENSION environment variables. Set them in the registry.
    UI_ICON=location where you have the image files.
    UI_ICON_EXTENSION=Extension of your image files (ICO / GIF / JPG)
    Edit :
    Refer : http://www.oracle.com/technology/products/forms/pdf/10g/frm10gnewfeatures.pdf
    Search for UI_ICON and UI_ICON_EXTENSION
    -Arun
    Edited by: Arunkumar Ramamoorthy on Jan 26, 2010 6:26 PM

  • Where to put the properties file

    I am a new user of NetBeans6.0, I am making a simple application for user registration. I have coded everything but when I run project I get error caused by the dao.properties file load problem.
    I have put the dao.properties file inside the classes directory(where all java class files are build after running the project) of my web application directory( I didn't create this directory though, it is automatically created by IDE), I think there is a problem with its path.
    where should I put the dao.properties file so that when I run the project the Tomcat automatically find it and also, what the settings I should do?
    actually, I have referred to BalusC'd  DAO tutorial: the data layer but that comes in use when we are working off the IDEs, In my case since I am using Netbeans so it may be different from that one.
    if someone already done that then please let me know

    ok, but will it work if I upload the project in a remote host?
    lets talk besides IDE, as in your DAO tutorial you have instructed to put the properties file somewhere in root of the classpaths. ok, it will work on a local computer cause there is classpath setting but since remote host doesn't know about that property file and we cant set classpath at remote host(I am not sure though if we can) then how will it work at remote host.
    how the server at remote host comes to know about that property file?
    In my case since I have made the project using IDE and everything regarding classpaths have been set automatically(IDE done itself), but at remote host these sort of settings are not done then how the project will run?
    if I have described my problem incorrectly then please consider it as it is supposed to be.

Maybe you are looking for