Where to put .OpenSAPConnection

I am developing an asp.net application that loads information from our CRM system and presents it to the user.
I want set up the connection and load the data as the page is being set up.
The trouble is, if I put the .OpenSAPConnection call in the Page_Load event, it seems to start the entire page even cycle all over again after the load even completes ...
ex. if I put it in the Page_Load event, as soon as this event completes the Page_Init is fires again, followed by the Page_Load event (again) ... resulting in an infiite loop.   I suspect this is the result of trying to write the connection to the viewstate before it is create.
Where can I put the connection given that I want load the data into the page controls before the rendering event fires???
-Sheldon

Hi Sheldon,
after reading your code, a few thoughts come to mind
is there any specific reason you are explicitly calling OpenSAPConnection ?
as per the class doculentation it is used internally, it is sufficient for you to get the connection :
proxy.Connection =  SAP.Connector.SAPLoginProvider.GetSAPConnection(this);
with respect,
amit
http://help.sap.com/saphelp_nw04/helpdata/en/8f/3de39b752d284b98b25bad8c8d6b90/content.htm
when you open a connection, it should be assigned to a proxy class to be able to consumed
also once you are done with the connection a close should be incorporated
the connection is to be specific to a proxy, and it is a good practice when you close it when you do not need it
i use connection pooling as well :
e.g.
SAP.Connector.Connection con2SAP;
con2SAP = myConnector.conEstablishConnection(strConnection);
if (con2SAP != null)
SAPProxyUserDetails prxUserProxy = new SAPProxyUserDetails();
BAPIRETURN brtUserDetails = new BAPIRETURN();
ZUSERLIST zpsUserList = new ZUSERLIST();
ZUSERLISTTable zptUserList = new ZUSERLISTTable();
try
con2SAP.Open();
prxUserProxy.Connection = con2SAP;
prxUserProxy.Z_Portal_Get_User_Details(strUserDomain, strUserName, out strRetDomain,out strExUser, out strFullName, out brtUserDetails,out strRetUserName,out strUserType, out strVendorId, ref zptUserList);
// check if details were retrieved and process results
catch (Exception ex)
string strError;
strError = ex.Message.Trim();
finally
if (con2SAP.IsOpen)
// close connection
     con2SAP.Close();
where :
public SAP.Connector.Connection conEstablishConnection(string strConnection)
SAP.Connector.Connection conReturn;
conReturn = null;
if(strConnection.Trim() !="")
conReturn = SAP.Connector.SAPConnectionPool.GetConnectionFromPool(strConnection);
return conReturn;
public void conReturnConnection(SAP.Connector.Connection con2Return)
if(con2Return !=null)
con2Return.PrepareForPooling();
SAP.Connector.SAPConnectionPool.ReturnConnection(con2Return);
con2Return = null;

Similar Messages

  • Where i Put my swing application jar file in jboss

    Hi experts...
    I develope swing application and convert it into jar file....I know jnlp deployment using tomcat..In tomcat i
    put my appcation.jar in webapps/root folder...This is not similar in jboss..I dont know where i put my applcation.jar in jboss.If any body know the idea please let me know..

    Hi
    You have to put your jar file in
    server/default/deploy
    Regards
    M Fazal Ur Rehman

  • 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.

  • My computer screen keeps going blank and then going back to the box where I put my password in to start my comp. Why is this happening?

    My computer (Macbook) was working fine this am. I left it for an hour and then came back and the screen was black (always does that as the screensaver hardly ever works). I moved the mouse to wake it up and everything was normal. I went to adjust the volume and the screen went blank and the main page with the box where I put my password in when I first start my comp appeared. I put my password in and everything was normal again. I opened a window in Safari and before it loaded completely the same thing happened, the screen went blank and went back to the password box. Does anyone know why this is happening? I don't have an external hard drive or any blank flash drives so I can't back anything up right now and am afraid I'm going to lose everything. Thank you

    Sounds like hardware failure, called boot loop. Call Apple and or go on apple.com and make Genius Bar appointment to have your iphone reviewed by a Tech. Provided you iphone shows no physical or liquid damage they will take care of you, or if you have Apple Care Plus
    Genius Bar Rerservation :  http://www.apple.com/retail/geniusbar/

  • I am trying to organize a zip file with a bunch of links and files. But when I drag an image file to a folder, it always "Snaps to grid" instead of just landing where I put it.

    I am trying to organize a zip file with a bunch of links and files. But when I drag an image file to a folder, it always "Snaps to grid" instead of just landing where I put it. All of the files are going into the same zip file but I want them visually in the space that I put them and not at the bottom of the snap to grid folder location they are looking like.  I am trying to  drag and drop files in groups so that I can group them for now, but image files always do their own "sort by" when I drag them from my web pages. Links don't do it though.  I tried resetting the folder, and deleting the DS files. No luck.

    You keep asking variants on this same question. You've had replies in all your other threads. If you can't find them, go here and click where it says Activity:
    Thomas Cannon Jr.

  • Where to put javascript code?

    Hello,
    I am trying to set some columns in a list as "read-only" and is using the following code:
    <script type=”text/javascript”>
    function SetReadOnly()
    var elements=document.getElementById(’4_ctl00_ctl00_TextField’);
    elements.readOnly=true;
    _spBodyOnLoadFunctionNames.push(“SetReadOnly()”);
    </script>
    But I am not sure where to put the code in. Should I put it in the space in Content Editor Web Part,
    or through a link to a txt file, or in "Edit HTML"? I've tried them but none works.
    Thanks a lot!
    Patrick

    You can try this:
    1) Open your Sharepoint List. Go to List edit view.
    2) On right side of Ribbon you will find "Form Web Parts" option as shown in figure.
    3) Choose your List form which you want to edit.
    4) Now you can add web part in new window.
    5) Add Content Editor Web part.
    6) In content editor web part add the path of your "txt" file in which you have written your script, for eg.
    <!DOCTYPE html>
    <html>
    <body>
    <script type=”text/javascript”>
    function SetReadOnly()
    var elements=document.getElementById('4_ctl00_ctl00_TextField');
    elements.readOnly=true;
    _spBodyOnLoadFunctionNames.push("SetReadOnly()");
    </script>
    </body>
    </html>
    I haven't tried this method so I am not sure but hope it works...:D
    ***If my post is answer for your query please mark as answer***
    ***If my answer is helpful please vote***

  • This is less a question and more of a suggestion and I am not sure where to put it..... I would like an update that would allow you to have a tone for each individual email account

    I am not sure where to put this but I would like individual tones for all my email accounts

    Wonderful suggestion.
    You can give Apple feedback here > http://www.apple.com/feedback/
    Hop that helps

  • Why are many of my toolbar bookmarks suddenly missing, & why can't I designate where to put bookmarks now? Star won't accept double-clicks anymore.

    All of a sudden yesterday I can no longer click the star twice to tell it where to put the bookmark, and even when I click it once it doesn't save the bookmark anywhere. Also many of my toolbar bookmarks are now suddenly missing. I've tried to restore bookmarks and it says it's unable to perform that function. Help!

    You can check for problems with the <b>places.sqlite</b> database file in the Firefox profile folder.
    *http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox
    *https://support.mozilla.org/kb/Bookmarks+not+saved#w_fix-the-bookmarks-file
    *Places Maintenance: https://addons.mozilla.org/firefox/addon/places-maintenance/

  • 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

  • JSP--where to put my client keystore?

    I have my webservice working. I also have my java client working. Now i'm trying
    to create a web client using JSP to access the web service. This will need the
    message-based security. The java client works fine because I can specify the directory
    of the keystore. But I don't know where to put the keystore in my JSP client.
    Anybody has some suggestions? BTW i'm using tomcat 4.1.
    many thanks.

    Hi,
    Here's a pointer to the doc on how to setup a keystore using WLS 8.1
    http://e-docs.bea.com/wls/docs81/webserv/security.html
    For Tomcat, I don't know...
    Bruce
    BTW, you might take a quick look at this, it may be of some value.
    http://dev2dev.bea.com/resourcelibrary/whitepapers/whitepaper_tomcat_migration.jsp
    Yan wrote:
    >
    I have my webservice working. I also have my java client working. Now i'm trying
    to create a web client using JSP to access the web service. This will need the
    message-based security. The java client works fine because I can specify the directory
    of the keystore. But I don't know where to put the keystore in my JSP client.
    Anybody has some suggestions? BTW i'm using tomcat 4.1.
    many thanks.

  • 10g UIX Where to put ResourceBundle?

    I'm looking at putting all my Strings in a ResourceBundle for my UIX pages. I've read the documentation for Internationalization, but I think the piece that I'm missing is where to put the properties file. Say I've got a file called 'strings.properties', and my provider looks like this:
    <provider>
         <data name="bundle" >
              <bundle class="strings.properties" />
         </data>
    </provider>Then where in the JDev project do I need to have the file in order for it to get deployed properly and found by the UIX framework at runtime?
    Also, just to be sure I'm not going crazy, I know that the documentation and even the bundle tag say to specify a Class, and I just noticed that the ResourceBundle javadoc also says that the 'baseName' parameter to the static 'getBundle' method should be a 'fully qualified class name', but I've always just given it a filename of a properties file before. So I'm assuming that the 'class' parameter to the bundle tag can be a properties filename -- is this correct?

    Whoops! Of course, the argument to the bundle class attribute should just be 'strings'.
    After some experimentation, I discovered that if I put the properties file at the root of the 'src' directory in my JDev project, then it gets transferred to the 'classes' output directory when I compile. This works for running my project in the Embedded OC4J. I haven't tried deploying it to any other app server yet. Is this the right place?

  • JUnit, where to put my unit test

    Hi all,
    I have a question regarding unit test.
    I am working on a project which has multiple packages. I need to unit test every package using JUnit. One question I have is where to put my unit test. The options are:
    1. Write unit test as a separate package. This makes the code clear but only the public functions get tested or I have to make all functions public.
    2. Write unit test in the same package of the code to be tested. This makes writing test easier but putting test and code together makes the structure dirty.
    Please let me know your opinion and tell me how do you normally do this?
    Many thanks,
    Regards,
    Kevin

    It sounds like you're probably a beginner, so this might be overkill, but here goes anyway: You might want to investigate Maven, which defines a standard directory structure that includes a test tree separate from the production tree, but yet still in the same overall folder. The beauty of this design is that you can keep both production & test code together in source control, IDE projects, etc. but they don't interfere with each other.
    Even if you don't use Maven now, you might want to consider using their standard directory structure, as it is has stood the test of time, & would facilitate using Maven if you ever decide to in the future.

  • SInce i installed Lion, my desktop icons are lining up like regimented Windows icons!  how do i get them to stay where i put them, like they used to do?  thanks! ellen

    SInce i installed Lion, my desktop icons are lining up like regimented Windows icons! 
    how do i get them to stay where i put them, like they used to do? 
    thanks!
    ellen

    In that case, there may be a problem with your Finder preferences or window settings.
    Try removing these files, then restarting:
    ~/Library/Preferences/com.apple.finder.plist
    ~/Desktop/.DS_Store
    Let me know if you're not sure how to do that.

  • Where to put files in using runtime.exec(run.exe)?

    I try to use the following program in EJB to call my EXE program in the J2EE server:
    runtime.exec("c:\\j2ee\\public\\exe\\run.exe temp.txt");
    In the execution of mill_turn.exe, it will open several files for read and write.
    So where to put the file temp.txt and other files the run.exe need to read?
    Looks like the J2EE server can not find them?
    Thanks!

    I got it in Java SE1.4.
    File dir=new File("c:\\j2ee\\public_html\\Mill_turn\\exe\\");
    Process proc = rt.exec(cmd,null,dir);Use above codes, I really got the right output from my external program for the first time. But , after that, the output keeps same when I change the filename in the following code:
    cmd="c:\\..\\run.exe temp.prt"
    to
    cmd="c:\\..\\run.exe Abc1.prt" , which must have different output.
    The codes for calling external program are implemented in the SessionBean of J2EE.

  • How do I get Firefox to ask me where to put a file I wish to download

    When I download a file, Firefox puts it somewhere. I want to be able to tell it where to put that file each and every time.

    Options > General - Downloads = '''Always ask me where to save files'''

Maybe you are looking for