JDBC or Entity Beans for Read-Only Data?

Entity beans are way to slow on pulling the amount of data I need. What are the cons of just using JDBC? Is this bad programming?
One query pulls about 700 rows from 6 different tables taking up to 20 seconds. The same call using JDBC takes 2 seconds. What is the proper thing to do?

One query pulls about 700 rows from 6 different
tables taking up to 20 seconds. The same call using
JDBC takes 2 seconds. What is the proper thing to do?JDBC. Entity beans are not really suited for data across multiple tables. This can be best done with plain SQL +JDBC.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Using cache for read only data

    In my application I have to display some read only data (in number of drop down present on several portlets)
    this data might be driven from the database or from some XML/property file.Not decided yet.
    for example : Country /state/City/Zip code etc..
    Kindly let me know how can I implement the same in Weblogic Portal 10.0.
    Do I have to use some third party caching mechanism like Hibernate cache for this
    or
    Weblogic portal do support caching ??
    Please suggest the all possible soultions to implement this.

    Cache cache = CacheFactory.getCache("yourCache"); //any name can be passed, and you can create as many as you want , perhaps by functionality, perhaps by size etc. If you want to configure statically you must use this name in the xml file. If you define it in the xml file , you can administer the cache from Portal Admin
    cache.put("key","value");
    cache.get("key");
    There are other advanced things you can do like Time To live / flushing / auto reload the cache which is all described in the javadoc
    regards
    deepak

  • Best practice for read-only functionality

    Hi,
    I'm part of the development team of a system with about 100 screens. The customer would like us to add some read-only functionality to the system, so that certain users are able to access the screens but not change any of the data on them. We already have policies in place on the database level that keeps read-only users from saving data, but it's not very user friendly to allow users to change data on a screen, only to tell them that they're not allowed to save those changes once they try to do so. It would clearly be better if all components are rendered as read-only components for read-only users, making them unable to make any data changes in the first place.
    User privileges in the system are controlled by roles defined and set in the system (not ADF roles or Weblogic roles). At any given time and place, it's possible to check whether the current user has a certain role. We already use this in a number of places to make it possible to control which user has access to which screens. In a few places we even control which functionality should be enabled for the current user within a screen, but mostly the access control is currently on the screen level. With read-only users getting access to all screens, it seems we will need lot of extra in-screen access control to keep these users from changing anything.
    But what's the best practice here? One way to go would be to add some logic to every single active component on every single screen, to determine whether it should be rendered as active or disabled/read-only. But that would require a lot of extra coding.
    So my question is: Is there a smarter way to do this? Maybe something done through skinning? Or something else?
    (I'm not sure how relevant this is for this sort of question, but we're currently using JDev 11.1.1.4.0, and expect to upgrade to 11.1.1.6.0 within the next 6 months)
    Best regards,
    Andreas

    Hi Guna, Puthanampatti and Don,
    Thanks a lot for your replies. I'm currently looking into implementing something along the lines of what Guna has suggested:
    Our application consists of a number of individual work spaces that are deployed as adflibs which have all been added to a "master application work space", and the master application is deployed as an .ear file. Most of the individual work spaces are for all the different functional areas of the application, with their own task flows, page fragments etc. The rest are work spaces with common functionality, like datamodel (entity definitions), utility methods, page templates, and framework extensions. In the latter, we have defined custom classes for all the base classes (somewhat similar to what Don describes, I believe).
    In our custom class for ViewRowImpl, I have added an isAttributeUpdateable method, and in our custom class for ApplicationModuleImpl I have added an isReadOnlyUser method. The isAttributeUpdateable method uses the isReadOnlyUser method to determine if the current user is a read-only user or not; if the user is a read-only user the isAttributeUpdateable method will return false, otherwise true. The isReadOnlyUser method in our base class is just a dummy method that always returns true. But in the ApplicationModuleImpl classes of our individual work spaces, i've written an override for isReadOnlyUser, giving the answer that is relevant for the work space in question (for instance, whether or not the current user has the role "User Administrator").
    That pretty much takes care of all input fields in tables and forms, which is a big step in the right direction. This still leaves some work to be done for components that are not directly linked to view object attributes (like buttons), but I guess that can't be helped. Also, there are a few of the work spaces that contain a number of pages that are related to different user privileges (as in: page 1 requires user privilege A, and page 2 requires user privilege B); in these cases I will have to do something different than just writing an override in the "local" ApplicationModuleImpl class.
    @Don: What you describe seems to be pretty close in functionality to what we already have, though your implementation is different from ours. You have used your custom base ApplicationModuleImpl class to keep read-only users from committing changes. We use Virtual Private Database and database policies to the same end: If a user without the required full-access role tries to commit data it will cause a database error, which we then handle in the application (so the user gets a message like "You don't have the required privileges to changes this data", rather than an ORA message). Unfortunately, our customers are not content with this. They want a solution where all input fields and most of the buttons etc. are disabled for read-only users, and that's why I'm looking into the best/smartest way to do this.
    @Puthanampatti: We already use something similar to what you're suggesting. The challenge I'm currently facing is how best to disable/enable components based on the current user's roles, not how to determine and store those roles.
    Best regards,
    Andreas

  • Access denied to a READ-ONLY data source

    Post Author: covey9257
    CA Forum: Data Connectivity and SQL
    I'm using Crystal 10 sevice pack 6.  My report is using an ODBC connection to a PSql 9.5 stored procedure.  The stored procedure creates a temp table and inserts records from 3 different ticket tables.  It has one parameter in it that selects which location to load the table with.  My report works fine as long as I don't try to put any of the fields from the temp table on the report.  If I do, then I get the following error.
    Failed to open a rowset. Details: 42000:[Pervasive][ODBC Client Interface][LNA][Pervasive][ODBC Engine Interface][Data Record Manager][SPEng][Pervasive][ODBC Engine Interface]Access denied to a READ-ONLY data source.
    I found that this was an issue in Crystal 9.0, but nothing with cr 10.
    Does anyone know of a work around or fix for this scenario??
    Thanks - Cathy

    Thanks for the quick reply Don.
    If you have the option that Pervasive uses to not use the exclusive lock on the DB try adding it to the SQLExpression function in CR.
    I am not sure how to accomplish this.  I've done some quick searching but cannot come up with SQL that indicates locking unless I am using some kind of language like VB or C#.
    Here is my Command Object statement
    INSERT INTO RASAPSign
    (sVendNo, sChqNo, dtDateSigned)
    VALUES
    ('{?VendNum}', '{?ChqNum}', CURDATE());
    SELECT sVendNo, sChqNo, dtDateSigned
    FROM RASAPSign
    WHERE sVendNo = '{?VendNum}' and sChqNo = '{?ChqNum}'
    Can you give me an idea of what to change?  Or at least what terminology to search for?
    I tried this option with BEGIN and END
    BEGIN
    INSERT INTO RASAPSign
    (sVendNo, sChqNo, dtDateSigned)
    VALUES
    ('{?VendNum}', '{?ChqNum}', CURDATE());
    END
    SELECT sVendNo, sChqNo, dtDateSigned
    FROM RASAPSign
    WHERE sVendNo = '{?VendNum}' and sChqNo = '{?ChqNum}'
    But I get a syntax error.
    Thanks, rasinc
    Edited by: rasinc on Apr 14, 2011 3:28 PM
    To show code with Begin and End

  • 17076 : Invalid operation for read only resultset

    Hi,
    I am trying to update database table through java jdbc application.
    But while running the program i am getting the error message " Invalid operation for read only resultset: updateString " with error code 17076.
    My program is given below :
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    public class Misc2 {
    public static void main(String[] args) {
    Connection con = null;
    Statement stmt = null;
    ResultSet rs = null;
    try {
    con = JDBCUtil.getOracleConnection();
    stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
    String query = "select * from employees";
    rs = stmt.executeQuery(query);
    while (rs.next()) {
    String fname = rs.getString(3);
    if (fname.equalsIgnoreCase("Elmer")) {
    rs.updateString(3, "Mark");
    rs.updateString(2, "Robert");
    break;
    } catch (SQLException ex) {
    System.out.println("error code : " + ex.getErrorCode());
    System.out.println("error message : " + ex.getMessage());
    } finally {
    JDBCUtil.cleanUp(con, stmt);
    ****JDBCUtil Class****
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.Statement;
    public class JDBCUtil {
    public static Connection getOracleConnection(){
    Connection con = null;
    try{
    // Load the driver
    Class.forName("oracle.jdbc.driver.OracleDriver");
    //Establish Connection
    con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","ex","ex");
    }catch(Exception ex){
    ex.printStackTrace();
    return con;
    public static void cleanUp (Connection con , Statement stmt){
    // Release the resource
    try{
    if(con != null){
    con.close();
    if(stmt != null){
    stmt.close();
    }catch(Exception ex){
    ex.printStackTrace();
    Please help me to fix this issue.

    >
    But while running the program i am getting the error message " Invalid operation for read only resultset: updateString " with error code 17076.
    >
    Your result using 'SELECT *' is not updateable. Gimbal2 was pointing you in the right direction. You have to specify the columns in the select list to get an updateable result set.
    You also need to use 'updateRow()' to update the database and have a commit somewhere to keep the results.
    This code works for me. Note that I added an explicit SELECT list, the 'updateRow()' method and an explicit COMMIT.
        try {
            con = getOracleConnection();
            stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
    //        String query = "select * from employees";
            String query = "select first_name from employees"; -- added explicit SELECT list
            rs = stmt.executeQuery(query);
            while (rs.next()) {
                String fname = rs.getString(1);
                if (fname.equalsIgnoreCase("Adam")) {
                    rs.updateString(1, "Mark");
                    rs.updateRow();                                    -- need this statement to actually update the database
    //                rs.updateString(2, "Robert");
                    break;
            con.commit(); -- added explicit commit for testing
        } catch (SQLException ex) {See Performing an UPDATE Operation in a Result Set in the 'Updating Result Sets' section of the JDBC Developer's Guide and Reference
    http://docs.oracle.com/cd/B28359_01/java.111/b31224/resltset.htm#i1024720
    As gimbal2 also alluded it is considered poor practice to use column numbers to perform result set operations when you don't know for certain what column a given number refers to. Before people start jumping all over that statement let me clarify it. The key part is KNOWING what column you are referencing. It is more performant to access result column columns by column number rather than by column name since the methods that take a column name call the integer method under the covers anyway but have to search the array of column names in order to get the column number.
    With your query (SELECT *) there is no way to be sure the column order is the same since the table could be redefined with the columns in a different order or certain columns having been deleted. So for performance LOOP processing column numbers are used inside the loop but those column numbers are determined by using the metadata BEFORE the loop to convert column names to column numbers.
    That way you code (BEFORE the loop) can use column names but you use a set of integer variables (one for each column) for the actual access inside the loop.

  • This operation is not available for read only field 'Type MVF'

    Hi All,
    We are using OrderToCash PIP and we are on Siebel 8.1X.
    While Synching the customer from Ebiz to Siebel facing the following issues:
    Method 'WriteRecord' of business component 'Account' (integration component 'Account') for record with search specification '[Row Id] = "2d3434313239353"' returned the following error:"This operation is not available for read only field 'Type MVF'.(SBL-DAT-00402)"(SBL-EAI-04451)
    Please suggest us what steps to be done in Siebel.
    Thanks
    Maanasa

    First check the process why this is calling Account BC WriteRecord(). The field "Type MVF" might be read only and this sync process is trying to update this field which is read only. This is the reason for the error. Check the OM log / EAI Obj Manager Comp log (set log level to 5) and check.
    Joseph Arul Dass

  • Tabular Form Read Only Date Picker

    Hello,
    I have two or three Items with date pickers and do not want to implement
    this code because it will be too many buttons on my form. I need to clear one item
    at a time when the datepicker is readonly but, in a tabular form.
    function f_clear_items()
        {$x('P1_ITEMA').value = ''};
        {$x('P1_ITEMB').value = ''};
        }Then once I create a url button and pass this function I can clear the datepicker's. But, I
    was wondering is there a cleaner way to this.
    I have other items on the page that are named the same but, in different tables. I only want
    to clear each date picker item at a time. This code works fine for a regular form.
    -Element Post Element Text for the Item to Clear
    a href="javascript:setValue('P1_ITEMA','');">Clear Date</aThere is a thread named 'How to clear a read only page Item...?' that states how this code works but, does not
    work for a tabular form in a Master Detail page. There is a link on side the Date Picker to clear item specified but, in a tabular form Item, there is no Element tab, any ideas on how to clear a readonly date picker item using a tabular form
    and not using a button for each item, thanks in advance. I am using Application Express 3.2.0.00.27.

    Dan,
    I totally understand your point of view. So, this tabular form aspect was not tested once the Clear Date link was discovered to clear a Read Only date field. Yes, using a button to clear a date is great but, I do not want to clear every date or specified item with the click of one button for this application. It is very useful but, not for my needs at the moment.
    Basically, if a date is selected and it needs to be cleared out you can just delete the value. But, if the date is readonly you can not clear/delete the date value unless you have the Clearing functionality for a particular item using the datepicker. It may not be worth the trouble Dan like you state by adding this extra code to the calender. If an invalid date is entered an error will appear anyway.
    Thanks alot Dan for expanding my mind and showing me some JQuery and providing me with this link to do some further research if needed, thanks again.

  • Support for Read Only EJBs ?

    Hi;
    I'm trying to discover if OC4J 9.0.3 provides support for Read Only Entity EJBs? If anyone can point me to docmentation on deployment descriptor elements controlling this, I'd be most grateful..
    Thanks in Advance;
    Simon

    Simon -- We do support read-only concurrency in OC4J. Have a look at the EJB Developer's Guide (available on OTN) for more information. It is in the section on locking modes.
    Thanks -- Jeff

  • Can anyone describe using entity beans for persitance in Software Architect

    Can anyone describe using entity beans for persitance in Software Architecture you built for a product?

    Although this forum is supposed to help you gain knowledge on entity beans, its not a free rider that's supposed regurgitate everyone's knowledge to you.
    Read something first and then clarify your thoughts with this forum.

  • Enter event not triggering for read-only checkbox

    I have some objects in a form that get "locked" when the user signs the form.  I'm not using the digital signatures.  Instead, when the user types their name into the signature text field, a script runs on the change event that makes all of the fields in the form read only.  It also unlocks the fields if the signature is deleted.
    I was worried that we would get a lot of phone calls with users that didn't understand that the form had locked ("Why doesn't this form work?!"), so I added some code to the enter event for all of the fields that would pop up a messagebox to explain to people trying to edit a signed form that the form was locked and that they would need to delete the signature to edit the form.
    This plan works perfect for my text fields and decimal fields.  It does NOT work at all for my checkboxes.  For some reason, the enter event is never triggered for read-only checkboxes.  I don't see any other events that would obviously work for me though.  Any ideas?
    Thanks

    Thanks, those are reasonable suggestions.
    In the first suggestion, I'm unclear about one aspect of how I would accomplish this.  I assume I would allow people to modify fields in the form, but that when they did, a msgbox would pop up that would inform them that, if they continued with this modification to a signed form, the signature would be removed.  I'm all good to that point.  But if they answered that they do not want to continue modifying that field and removing the signature, how can I code it to set the value back to what it was before the change?  Is there some method that will give me access to the value of the field BEFORE the attempted modification?  I went looking for something like $.previousvalue, but found nothing.
    I'd suggest that I could use a two-stage solution, in which I store the previous value on the enter event, and save it just in case they do not want to change the field when prompted by the msgbox, but since the enter event does not exist for checkboxes (my original problem), that seems like it won't work.
    As far as radio button suggestion, I like radio buttons very much except for one fatal flaw: they aren't (as far as I can tell) clearable.  That is a shame.  Clearly some people (like me) want both exclusivity AND clearability.  And we'd like the controls to have an enter event.  But I know I'm demanding   Anyway, as it is, I just end up having to use checkboxes and create a boatload of silly code to make them exclusive.
    Emily

  • SharePoint 2010 List View Web Part not showing for read-only users?

    Hello all,
    I have List View Webparts on my Blank Web Part page, and it's not showing for Read-Only users.
    Is this intended by Microsoft or is it a bug?
    Thank you!

    Hi,
    According to your post, my understanding is that the read only user could not see the list view web part.
    Per my knowledge, the issue may be cause that the user do not have the proper permission for the list.
    1. Check whether the user can access the list.
    2. Check whether the user can view all the items instead of partial items in the list.
    3. Check whether there are some fields refer to other lists or terms, especially the lookup field or managed metadata filed.
         If that is the case, make sure the user can access the lookup list.
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jason Guo
    TechNet Community Support

  • Default value for Read-Only Picklist Field

    Hi, all--
    I would like to have a default value ("Undetermined") for the "Associated Account" read-only picklist value. I have an account record of this value for this purpose. This is because if there is no value in the field, the record will not be included in a report that includes the field. I do not want to make the field required at this point.
    Field management doesn't appear to allow any default value for read-only picklists. Does anyone know how to get around this, either at the lead record stage or at the lead report stage (without resorting to an analytic, which won't work for what we are doing)?
    Thanks.

    That's a great question. It doesn't appear as though you can select it from the typical method of Admin | Application Customization | Lead | Lead Field Setup | Associated Account.
    Have you tried creating a workflow to populate the field using Before Modified Record Saved?

  • We collected data using NI in the Labview environmen​t and created tdms document. Is there a reader for reading the data in Matlab environmen​t?

    We collected data using NI in the Labview environment and created tdms document. Is there a reader for reading the data in Matlab environment?

    A search will often turn up results.
    Reading TDM/TDMS Files with The MathWorks, Inc. MATLAB® Software

  • Invalid operation for read only resultset:

    Hi.
    I'm developing an app that connects to Oracle, but I ran into the following problem:
    When I create a Statement, I specify
    that I need an Updatable ResultSet with the following code:
    Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
    ResultSet.CONCUR_UPDATABLE);
    ResultSet rset =stmt.executeQuery(somesql);
    When I try to update the ResultSet, I get an SQLException: java.sql.SQLException: Invalid operation for read only resultset: updateString
    Am I
    doing something wrong or is this a bug?
    Any info is greatly appreciated.
    null

    There are limitations on the kinds of queries you can perform. If the query is not suitable for update, it reverts back to readonly automatically. Read the below article about limitations and examples.
    http://technet.oracle.com/doc/oracle8i_816/java.816/a81354/resltse2.htm
    null

  • How to monitor performance in Read Only data base

    Hi,
    We have a read only database that is using us to run reports against it.
    1. How can i monitor performance in this read Only database ?
    If i cant run statspack , how can i know what happened last hour for example
    in the database ?
    2. I use the glance utility to monitor the OS.
    I see that the Disk Utilization is 100% and the swap is 80%.
    Any suggestion what to do ?
    Thanks

    Hi,
    Since the database is read only its cant be done:
    clone SYS@pcrm > @spcreate.sql
    ... Installing Required Packages
    create or replace package dbms_shared_pool is
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-16000: database open for read-only access
    Thanks.

Maybe you are looking for

  • Random kernel panics going on for a long time, desperate for help!

    Hi, I didn'nt quite know what to name this thread, but I will try to describe the problems I have with my MacBook Pro here. I have a mid-2009 MacBook Pro and the problems started more than a year ago. They are present under both Snow Leopard and Lion

  • I need help urgently!!!  How do you get a button to open up a menu or something that has more buttons on it.

    I need to find out how to create a button that when pressed will bring up a menu with other buttons on it. I am doing this for a school assignment. Basicly, i select "Shoes" and that brings up a menu where i can chose from a bunch of different shoes.

  • Replacing Type and Creator in InDesign Mac

    Hello Everyone: Our plant uses a process that FTPs InDesign files to Unix servers for storage and then FTPs them back down to local Macs for work. In the process the file is stripped of filetype and creator. I have been tasked with writing a module t

  • WLS 8.1 sp1 NameNotFoundException

    Weblogic Sever 8.1 sp1, under Windows XP Professional version 2002 sp1. I am getting an EJBException NameNotFoundException while trying to look up Session bean 2 from session bean 1. All the entity beans are found okay. I had this scenario working un

  • ATV2 keeps logging out of Home Sharing

    I've been having quite a few problems with the ATV2 recently.  I have two of them, one in the living room and one in my workshop.  They both have had problems after the last update.  The most annoying problem is that at least once a day, the ATV2 in