Architecture purity vs. Resource access optimization

I'm working on a rather complex application with a number of pattern implementations like DAO and Service, but I'm not an experienced developer, so I often find myself in situation, when I can't decide, whether to pursue more strict pattern implementation, or break it in favour of resource access optimization.
For instance, if I have an object which is stored in database, or a JCR repository, it'd be nice to have a DAO+DTO and use DAO.save(dto) and dto = DAO.load() to load and modify the object. However, in many cases it's just one property of the object that needs to be modified, so I have methods like DAO.updateSomeValueOf(dto). I don't like those methods very much (:
So I'm wondering, are there some sort of articles or best practices explained to read on the web, (or even in a dead-tree form) to understand this problem better and don't feel so bad each time a DAO has to be modified?

s.p. wrote:
Yes, you're most probably right. This is something I'm doing following an advice from a senior developer ("it's best to have the least number of database queries in almost all cases"), though now I'm actually thinking this is exactly what's called "premature optimization" (if it is in fact an optimization).
What does that have to do with your original statement though?
Say you have a customer and want to update the address and only the address (street).
The choices are write the entire customer record or write just the address.
In both cases there is one write. Only one.
Conversely say you want to update the address and zip code.
The choices are
1. Write the entire customer record
2. Write the address and zip
3. Write the address then the zip
Then 3 requires 2 writes. Thus not as good as 1/2.
However, all of the above is completely moot. It does not in fact matter if you did do 3. The reason is simple - there is no business case where you are going to be updating (versus creating) customers in such volumes that this would ever have any impact even in a business with a huge (millions) of customers.
Conversely that doesn't mean that you should ignore the implications. There can certainly be cases where minimizes writes is a good idea.
Of course none of this addresses queries rather than writes either. Most businesses will do far more queries than writes. Some businesses (think google) do vastly more queries than writes. Probably really not a good idea to query the name, then query the address, then query the street. However in some cases even then separate queries are good ideas. For example if you query a customer you would not want to query all of the orders for the customer even though you know that the next query will in fact want a order (but only one.)

Similar Messages

  • How do you use Default Resource Access Information?

    I have some 10g Forms & Reports that I want to use with SSO and they will all be connecting to the database with the same connection info. I know how to configure a Default Resource Access Information, but how do you use this with Forms & Reports?

    Douglas,
    the default Resource Access Infomation should be the connection information right? This is used in conjunction with SSO. You need to configure your F&R applications to delegate authentication to SSO by placing ssoMode=true in the config section of formsweb.cfg.
    The Forms Servlet will connect to OID retrieve the Resource Access Information (descriptor) for a given user and automatically log them into the application.
    Users will need a global identity in OID and SSO must be enabled to use resource access info with F&R
    regards,
    tt

  • Android MS RDP - RPC Error: Your connection was denied because of a Resource Access Policy (TS_RAP). Please contact your server administrator. (2147965402).

    I love iTap Mobile.  Paid for the app.  Sorry to see them discontinue it, but now I know why.  Microsoft bought them out!  But even though free, I am getting an error: RPC Error: Your connection was denied because of a Resource Access
    Policy (TS_RAP). Please contact your server administrator. (2147965402).  I worked with iTap to fix this so I guess they sold Microsoft their older buggy code...  Microsoft, please fix!
    PS: This is the Android version.  Mac and iOS are both okay.
    EDIT:  After an update a few months ago, iOS is no longer working.  Not sure if the problem is related to the Android MSRDP issue.
    UPDATE - Relevant posts (need Android RDP software engineer to fix):
    Event Viewer Log when using Android client:
    The user
    "DOMAIN\testuser", on client computer "10.x.x.x", met connection authorization policy requirements and was therefore authorized to access the RD Gateway server. The following authentication method was used: "NTLM". (This
    is most likely for logging into RD Web - icons shows up).
    The
    user "DOMAIN\testuser", on client computer "10.x.x.x", did not meet resource authorization policy requirements and was therefore not authorized to resource"localhost".
    The following error occurred: "23002".  (This is after clicking on any
    of the icons).
    I
    think the Android MS RDP client is providing the incorrect resource.  It shouldn't be "localhost".
     It should be the RD Connection Broker's hostname, I believe.
    Here's what it should look like (connected using a Windows PC going
    through the RD Web portal via Internet Explorer):
    The user "DOMAIN\testuser", on client computer "10.x.x.x", met connection
    authorization policy requirements and was therefore authorized to access the RD Gateway server. The following authentication method was used: "NTLM".
    The user "DOMAIN\testuser", on client computer "10.x.x.x", met resource
    authorization policy requirements and was therefore authorized to connect to resource "rdsfarm.domain.com".
    The user "DOMAIN\testuser", on client computer "10.x.x.x", connected
    to resource "rdsfarm.domain.com".
    Stephan,
    Do you have any way to contact the software engineer who worked on the Android version of the RDP client?  Please
    have them read this thread.  They need to fix the hard coded "localhost" resource to be a variable (namely whatever the user put in for the server).
    This is why the MS RDP app is failing in situations where the FQDN for the RD Gateway and Connection Broker uses
    the same host name.
    Again, this is not a configuration problem on our end as it works as intended with the native Windows RDP client
    as well as the Mac and iOS version of the mobile RDP client (all based on iTap Mobile's RDP app).
    This is a problem specific to the Android RDP app.
    PS: No matter how hard I try, the WYSIWYG editor is not very WYSIWYG at all, and so everything here looks messed up even though it looked right when I posted it (it is deleting new blank lines I'm inserting to make it spaced out and easier to read). See
    below to read the post in context.

    Thanks for the bumps, everyone.  I haven't check this thread in a while because I basically gave up on Microsoft's ability to respond.  Unlike paid apps, there's no number to call or ticket to open when an app like this malfunctions.
    Just to give you an update, iOS users started having issues connecting a few months ago.  I don't remember what version started this.  I'm not sure if it's the same problem.
    Also, the newest version now gives a slightly different error message:  RpcOverHttpEndpointException: 2, Your connection was denied because of a Resource Access Policy (TS_RAP).  Please contact your server administrator.
    For Android users, I am starting to recommend Xtralogic Remote Desktop Client.  It's a paid app, but it works great.  I don't know of any alternative for iOS.
    MSRDP for Mac OSX (was also an iTap application) continues to work throughout the many updates.
    We need a software engineer from MS to read my first post.  All the information that will point to a fix is there.  I strongly believe someone hardcoded the string "localhost" instead of using a variable to point to the FQDN of the rdsfarm
    name.
    Here's that info again (copied/pasted).  It doesn't take an engineer to understand the issue.  If you know how to decipher Event Logs, you can see where the problem is.
    Event
    Viewer Log when using Android client:
    The
    user "DOMAIN\testuser", on client computer "10.x.x.x", met connection authorization policy requirements and was therefore authorized to access the RD Gateway server. The following authentication method was used: "NTLM". (This
    is most likely for logging into RD Web - icons shows up).
    The
    user "DOMAIN\testuser", on client computer "10.x.x.x", did not meet resource authorization policy requirements and was therefore not authorized to resource"localhost".
    The following error occurred: "23002".  (This
    is after clicking on any of the icons).
    I
    think the Android MS RDP client is providing the incorrect resource.  It shouldn't be "localhost".
     It should be the RD Connection Broker's hostname, I believe.
    Here's
    what it should look like (connected using a Windows PC going through the RD Web portal via Internet Explorer):
    The user "DOMAIN\testuser", on client computer "10.x.x.x",
    met connection authorization policy requirements and was therefore authorized to access the RD Gateway server. The following authentication method was used: "NTLM".
    The user "DOMAIN\testuser", on client computer "10.x.x.x",
    met resource authorization policy requirements and was therefore authorized to connect to resource "rdsfarm.domain.com".
    The user "DOMAIN\testuser", on client computer "10.x.x.x",
    connected to resource "rdsfarm.domain.com".

  • Get Resource Access Descriptor from OID in Java

    Hi,
    I'm trying to get my ADF program to read DB credentials from a Database RAD - Resource Access Descriptor defined for my SSO users in OID (version 10.1.2.1.0).
    Examples are rare and sometimes they refer to deprecated functions or librairies.
    If someone had already the pleasure ;-) of reading username, password and database from a predefined RAD in OID please help: steps, examples, version of libraries, anything would be very much appreciated.
    Many thanks in advance,
    Pierre

    The api�s are suitable for the values in proper table
    format.
    But the excel sheet is like a form and from that i
    have to get the values.Write an ActiveX plug-in for Excel that will send the values to your Java program. Or write an ActiveX plug-in for Excel that runs your Java program and passes it the values.

  • Unable to review the resource access information

    Hi,
    I am new to portal. I am runing Oracle Portal Version: 10.1.2.3.0 (Build: 263).
    I am able to review or edit my resource access information. However, I only see the blank information when I try to modify the other users. Could somebody let me know what privileges I miss? How do I assign the privileges to my portal group?
    Thanks for your help,
    Kam

    Hi AMN,
    Logn on as the portal user, I can see the information. Then I grant all the privileges to that particular user (User B). I still do not see the resource information after log as User B.
    I have another user account (User A) that belongs to another admin group. If I log on as User A, I can see the resource information. Then I assign this admin group to User B. Log on as User B, I can see the resource information without any problem. I do not find any privileges differences between User B and the admin group.
    I can find the basic information related to the particular admin group, user A and user B information in oiddas.
    Could you show me what information I should look for? What priivileges I need to set in OIDDAS or in portal?
    Thanks your help,
    Kam

  • OID Resource Access Descriptors in Forms and Reports

    Dear Colleage,
    In my Forms application (Oracle Application Server 10g (version 9.04), I call Reports from certain Forms. I have have SSO activated in both Forms and Reports. I have also defined two RADs (Resource Access Descriptors) in the OID called RKMSPROD and RKMSTEST, i.e. for the production DB and test DB respectively. I successfuly configured my formsweb.cfg file with [RKMSPROD] and [RKMSTEST] and can access the the corresponding DB using the URL parameter, e.g. CONFIG=RKMSTEST.
    Question 1
    ========
    Is the DB connection associated with the RADs (i.e. RKMSPROD or RKMSTEST in my case) implicitly passed on to the Reports server when I start a report job via the built-in RUN_REPORT_OBJECT or do I have to explicitly add the SSOCONN=RKMSTEST parameter before using the built-in RUN_REPORT_OBJECT?
    Question 2
    ========
    If I have to set the SSOCONN, how can I find out programatically, which RAD is currently active? I am using the same forms to access the two different DBs.
    Best regards,
    Charles

    Connect info is passed when making the RUN_REPORT_OBJECT call. No changes to Reports is needed. The only requirement is that both Forms and Reports have SSO enabled. The same information used to connect to Forms will be used to connect to Reports.
    More details are described in the Forms/Reports Integration White Paper:
    http://www.oracle.com/technology/products/forms/pdf/10g/frm10gsrw10g.pdf
    Specifically refer to the section titled "Using the Run_Report_Object () Built-in" on page 20.

  • OIM Custom reports - User Resource Access History

    HI,
    I am working on OIM custom reports . I was trying to get custom user resource access history( i.e., need to include information like field changed, its old value , its new value etc are the extra info I need in the report ). To achieve this I had used UPA_UD_FORMS and UPA_UD_FORMFIELDS. I have few questions in this process..
    1. The audit result does not include the about the initial access info of the user which he obtained during usr creation, the table are containing only the changes occured after the user creation. Am I missing something please suggest.
    2. And update_date and Effective_from date are not in sync .. any omments
    Thanks,
    Anumolu.

    I have been told that this historic data is stored in upa_ud_forms and upa_ud_formfields table.
    However, these tables are empty in my OIM environment. Is there a necessity to enable that audit data is written?

  • Clean out order is getting overloaded on the resource after optimization

    Hello Folks,
    I am using campaign optimization and after the campaign optimization is achieved by the optimizer the clean out order will be introduced. The clean out is overlapping with the actual operation on the resource.
    The resources used are finite resources and alert is getting generated stating that the resource is overloaded.
    The clean out order is expected to be sequenced correctly after the actual operation.
    Kindly let me know if anybody has faced this issue and have a solution for it.
    Let me know if you need any other details.
    Best Regards.
    Roopesh

    Hello Folks,
    This issue is solved.
    Maintain the production time of the clean out order as the setup transition time  among the same group in set up matrix, so basically after the number of charges defined in the campaign profile the optimizer will consider the time mentioned in the matrix and will create the space to fit the clean out order.
    Regards,
    Roopesh

  • How to get the 'mime-type' of a Resource accessed via WebDAV

    Hello,
    When a document is uploaded into a folder which is managed by a WebDAV RepositoryManager we don't see a Property 'mime-type' or something like that.
    Our code:
    <i>IPropertyMap lijstProp = tempResource.getProperties();</i>
    In the list there is no Property 'contenttype' or something like that!
    This is a bit of a surprise to me since it seems to me a very relevant Property of a Resource.
    How can the mime-type/contenttype of a Resource managed by a WebDAV Repository Manager be determined?
    Kind regards,
    Maarten Rutten

    Hi Thilo,
    We access the Resources via API.
    When I use "IPropertyMap lijstProp = tempResource.getProperties();" I assume that ALL the available properties are in 'lijstProp'.
    (is this correct?)
    I don't have the Property "contenttype" available in 'lijstProp'.
    A workaround could be that when adding documents to a folder via API's, we also should set this Property via API's.
    But when documents are added directly into the WebDAV folder we don't have that option. So, when we find a Resource with the Property 'contenttype' missing the only option I see is to 'calculate' the contenttyype based on the extension of the Resource.
    Do you agree?
    Kind regards,
    Maarten

  • Contradicting info about resources accessing

    Hello,
    I am a servlet newbie. I have gone through a lot of posts
    in the archives on accessing resources and now I am confused
    more than ever. The problem is that my guestbook servlet's doPost() will
    read and write a file on the same server.
    Now some posts say it should be rare that the servlet is called by two users at the same
    time and you shouldn't be worried about file locking. While other posts
    imply I need to make the servlet a single Thread servlet for this to work.
    And yet another group of posts suggest I could use normal servlet and
    synchronize the methods that read and write.
    So what exactly is the way to go about read and write one file?
    Any hints would be much appreciated!

    Now some posts say it should be rare that the servlet
    is called by two users at the same
    time and you shouldn't be worried about file locking.Very dangerous. If your app allows concurrent users, you must deal with concurrency issues.
    While other posts
    imply I need to make the servlet a single Thread
    servlet for this to work.If every user's session writes to the same file, then a single thread servlet will not solve the problem. You'll just have multiple instances of a servlet writing to one file instead of multiple threads of the same instance writing to one file.
    And yet another group of posts suggest I could use
    normal servlet and
    synchronize the methods that read and write. Sounds like the safest approach. If the same flat file is used by all, then synchronization is necessary. Create a class that handles all i/o to your file and add the synchronization code there.

  • JAAS LoginModule - how do I get path, port, resource accessed, etc

    Hi,
    I checked everywhere including the forums, but could not get any info on this. I'm writing a custom JAAS LoginModule for the WebAS 6.40 server. I'm trying to figure out how to get the following out of the request from within login() or initialize() or any other method:
    1. Name of the webserver (i.e. the WebAS server being accessed like www.mycompany.com)
    2. Resource (e.g. /QuickCarRental)
    3. Port through which the request comes in (e.g. 50000)
    The URL being accessed in the above case is http://www.mycompany.com:50000/QuickCarRental
    Appreciate your help, and points will be awarded. Have a nice day
    R Abraham

    This is only available for NetWeaver Portal, not NetWeaver Application Server(WebAS). host and port can be obtained using the following code:
                   Callback[] callbacks = new Callback[3];
                   callbacks[0] = new NameCallback("UserId: ");
                   callbacks[1] = new PasswordCallback("Password: ", false);
                   // get host name and port
                   HttpGetterCallback getterCallback = new HttpGetterCallback();
                   getterCallback.setType(HttpCallback.HEADER);
                   getterCallback.setName("Host");
                   callbacks[2] = getterCallback;
                   try {
                        callbackHandler.handle(callbacks);
                   } catch (Exception ex) {
                        throw new LoginException(ex + "");
                   Object retValue = ((HttpGetterCallback)callbacks[2]).getValue(); //get host
    host and port will be returned in the following format SERVER.COMPANY.COM:50000
    Currently WebAS is not able to return the resource as per SAP development.

  • Order not going to alternate resource after optimization

    Hi all,
    My requirement is order need to be scheduled on all alternate resource... and also it will adhere product sequence...
    I have given cost as follows in optimization profile..
    Make span=100
    Setup cost=60
    Mode cost=25
    Cost and time i have maintained in setup matrix.
    In the cost tab of optimization profile i have given A=10,B=100 as variable and 100,200 in fixed column..
    Product sequence is some how adhering..but order is not going to alternate resource....
    Thanks
    pardeepta

    Hi Pradeepta,
    I Believe, that might be u r observation.
    To achieve the required scenario which you have given, plz follow the below steps
    1. Plz check whether u have defined mode priority in PDS or not. If not plz define.
    2. After maintaining do new explosion of transaction data
    3. Plz maintain the weights in basic settings of optimization profile as "make span = 0", Total setup time = 50, Total mode cost = 70,
    4. In Cost tab maintain fixed mode cost as A = 10, B = 12, C = 14 etc (In multiples of 2)
    When you try this example ensure that u have 1 and half day load & give scheduling horizon as 1 day while optimization for the resources A, B & C.
    System will schedule on Primary resource A first then it willl schedule on alternate resource B. If resource B is also full then only it schedule on resource C.
    Note: If you define make span, then system will thing that you want to produce ASAP and results will be accordingly. make span has no relation with mode priority.
    Regards
    Sravan Maturu

  • Resources on optimize Apache and MySQL.

    Hello,
    I have just tested MySQLTuner, and I manage to what I believe is to reduce the footprint of the MySQL-daemon.
    Now I want to optimize Apache.
    Therefore I ask here, do you guys have any good resources on optimizing a LAMP server? I am using the basic LAMP page on the wiki.
    Birger

    Sorry, I solved myself...
    I forgot to put:
    sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
    this solved all first two problem
    third answer is: _www
    gianfranco

  • Using Profile to limit resource access

    Hello,
    I'm trying to use the profile feature to limit access for specific users the featue I want to limit is:
    CPU_PER_CALL defined as follow: Limits the amount of CPU time that can be consumed by any single database call in any session established by a user with this profile. The specified value is in hundredths of a second and applies to a parse, an execute, or a fetch call. These calls are implicitly performed by the database for any SQL statement executed in SQL*Plus and can be explicitly called from OCI, Java, or PL/SQL programs. When this limit is breached, the statement fails and is automatically rolled back, and an exception is raised.
    My question is:
    How can I from a SQL stmt, measure the number of cpu per call ? I cannot guess this value otherwise if wrong the SQL stmt will fail evry time!
    I'm on 10g, windows server 2003
    Thank for your help

    You can see that information at sql_trace files.
    Turn on traces in session using
    SQL> alter session set sql_trace=true; --to current session
    SQL> exec dbms_system.set_sql_trace_in_session(SID, SERIAL#, TRUE) -- to another session
    After stmt executes make a plain text by tkprof tool
    # tkprof xxx.trc xxx.txt explain=user/pass aggregate=no
    The file xxx.txt mensures the CPU per call for stmts ... the option aggregate=no it's mandatory if you execute more than 1 binded sql statement
    Regargs.
    Marcio Paiva

  • Looking for resource: accessing session info from JPS portlets

    Hi! The Portal Developer's Guide 10g Release 10.1.4, section 7.2.5 shows how to access session information from PDK portlets. I'm looking for information (tutorials, books) on how to do this from JPS portlets in the Oracle Portal environment.
    Thx!

    If u are using JSPProvider, then for getting the Session variable, peruse the below points:
    JSPProvider p=(JSPProvider)pageContext.getAttribute("JSPProvider");
    Session ses=p.getSession();

Maybe you are looking for

  • How could I export FCE project into XML format?

    Hello, I recently decided to upgrade from Final Cut Express to Final Cut Pro X. But I don't seem to be able to export my FCE unfinish projects. That is because FCE  does not export into XML format !!! Does anyone knows how to have FCE to generate a X

  • Matthew :: Request for Feedback Gallery :-)

    I was wondering if I could make a special request to Matthew. I wonder if you would be willing, and also if there would be enough demand, to create one of your lovely galleries for the purpose of clients offering feedback? Photoshop's Feedback Galler

  • Unable to open movies in certain sites using Firefox 4, no problem with former versions

    As a almost daily visitor of the site Bigfun.be I got a crash every time I wanted to open a movie, since I started using Firefox 4. After some automatic updates, the crashes disappeared. But it's still unable to open movie files. There is a message w

  • Load Report Failure error

    I have a combobox (windows app c# VS2005 CR XI R2) when I change selection I want the appropriate report to be displayed. It only works first time! If I run in debug mode and break on SelectedIndexChanged and then press F5 to continue it will work, b

  • Free upgrade possible?

    This might be hopeful wishing, but I just bought my first Mac a little less than 2 weeks ago (MacBook Pro-15") and now I just saw, that for the same price, it's now 2GHz instead of the 1.83 that I just got. Is there any chance that I could be upgrade