Connection not it's released.

In what cases the following code wouldn't work?
I'm doing this procedure to insert records on the database, however, to each record that is inserted is opened a new connection with the database.
The connection is opened, but it not it's closed.
Anyone know tell me what may be happening?
I'm using JDeveloper Studio 11.1.1.4.0.
ADF Swing.
        ApplicationModule am = null;
        public void adicionaRegistroIcatbEstacaoComView(Estacao estacaoAcess){
            String appModule = "hidro2.gov.snirh.ig.hidro.model.adf.app.AppModuleEstacao";
            String config = "AppModuleEstacaoLocal"; // Config name
            String viewObject = "IcatbEstacaoEnViewUp1";
            try{
                if (am == null) {       
                    am = Configuration.createRootApplicationModule(appModule, config);
                ViewObject vo = am.findViewObject(viewObject);
                Row row = vo.createRow();
                row.setAttribute("EstId", estacaoAcess.getEstId());
                row.setAttribute("EstNm" , estacaoAcess.getEstNm());
                row.setAttribute("EstStrId",estacaoAcess.getEstStrId());
                row.setAttribute("EstCdFlu", estacaoAcess.getEstCdFlu());
                row.setAttribute("EstCdPlu", estacaoAcess.getEstCdPlu());
                row.setAttribute("EstIcCampanha", 0);
                vo.getApplicationModule().getTransaction().commit();
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                if (am != null) {
                    Configuration.releaseRootApplicationModule(am, true);          
                    am.remove();
  }Edited by: Le on 11/08/2011 09:02

ADF uses the application module pool, which in turn uses a connection pool. Your code look OK to me, only the am.remove() is a bit fishy as you returned the application module ans told the framework to keep it for reuse. I'm not sure what this am.remove() does in this case.
The problem I see is that you create a root application module each time you call this function. This is a costly operation, as creating a root application module forced the framework to build it from scratch (and probably use a fresh db connection).
I'm by no means an expert in ADF Swing, but you should avoid creating an application module each time you call a function. If you reuse an application module (which is the default case for web apps) your connections get reused too.
Timo

Similar Messages

  • Provider not installed properly & at times Connection not open

    Hi developers,
    I am almost very new to Macros VBA. I did much R&D to fetch data from Oracle database to excel sheet. I don't have any oracle software in my machine nor any drivers related to oracle. I request someone to provide me exact oracle  required drivers
    link to fetch the data. I am running Windows 7 64 bit OS & excel 2010 32 bit. 
    I am asking proper required drivers again in the question because, I installed 64 bit 10g Release 2 ODAC for Windows Itanium.
    http://www.oracle.com/technetwork/database/windows/downloads/index-090165.html
    Now, my question is, when I run the below script it throws Provider may not be installed properly or connection not open sometimes. I am confused totally on getting the data from oracle database. I don't know what is TNSNAMES.ORA file also & its location.
    Some body please help me, I urge, in completing this fetching task from oracle database.
    Sub Button1_Click()
    Dim Conn As New ADODB.Connection
    Dim RS As New ADODB.Recordset
    Dim Cmd As New ADODB.Command
    Dim sqlText As String
    Dim Row As Long
    Dim Findex As Long
    Dim Data As Worksheet
    Dim X As Long
    Dim UID As String
    Dim PWD As String
    Dim Server As String
    Dim strCon As String
    Application.Calculation = xlCalculationManual
    UID = "myUsername" 
    PWD = "myPassword" 
    Server = "myServerName" 'This comes from your TNSNames.ora file
    Set Data = Sheets("Sheet2") 
    Data.Select
    Range("A:F").ClearContents 'Change A:F to the range you expect data to return to
    Conn.Open "PROVIDER=MSDAORA.Oracle;DATA SOURCE=myServerName;Database=myDatabaseName;UID=myUsername;PWD=myPassword;"
    Cmd.ActiveConnection = Conn
    Cmd.CommandType = adCmdText
    ' Put your query next
    sqlText = " select * from Oracle_Table_Name "
    Cmd.CommandText = sqlText
    Set RS = Cmd.Execute
    For X = 0 To 17 
    Data.Cells(1, X + 1) = RS.Fields(X).Name
    Next
    Do While Not RS.EOF
    Row = Row + 1
    For Findex = 0 To RS.Fields.Count - 1
    Data.Cells(Row + 1, Findex + 1) = RS.Fields(Findex).Value
    Next Findex
    RS.MoveNext
    Loop
    Application.Calculation = xlCalculationAutomatic
    Application.Calculate
    End Sub
    I have few cases as below:
    1. When Provider name is changed to "PROVIDER=MSDAORA.Oracle" ---> it throws error as
    Connection not Open.
    2. When Provider name is changed to "Driver={Microsoft ODBC Driver for Oracle}" ---> it throws error as
    [Microsoft] [ODBC Driver Manager] Data Source Name Not Found & no default driver specified.
    3. When Provider name is changed to "Provider=OraOLEDE.Oracle" ---> it throws error as
    Provider cannot be found. It may not be properly installed.
    I request to please help me from beginning to start this process. I would be very thankful to you. I am struck. Please help me. 
    sammy

    Hi;
    I have applied the note.
    But the system tells me Runtime error! R6034. An application has made an attempt to load the C runtime library incorrectly.
    And then again Provider for SQLDMO is not installed properly.
    I have installed vcredist_x64.exe ande vcredist_x86.exe. I have installed R3dllinst too.
    Could you please advise me again?
    Best regards
    Noyan

  • JCo Connection Not Proper!

    Hi,
    I am getting this warning message in the web dynpro screen while I am trying to run a particular method;
    Could not create JCOClientConnection for logical System: WD_MODELDATA_DEST - Model: class com.dow.dc.model.Model. Please assure that you have configured the RFC connections and/or logical system name properly for this model!
    Any idea why we get this error?
    I have not received this error while I was running the component first!
    Harika

    Hi
    It seems that this is a custom webdynpro application which when executed causes such problem. This might be due to JCO connection not released back to the pool.
    Please refer to the following threads and that might be helpful.
    Re: JCO Connection close
    How to close a model object connection for Adaptive RFC?
    You might have to call disconnectIfAlive method on your model.
    Regards,
    Anup

  • Firewire connections not supported....

    I had recently upgraded from a 20G to a 60G video. I honestly dont know what generation my first one is, but it is white and does not have a color screen...Anyway, on the older one, I am able to use firewire to load music from Itunes. When I tried to plug in the new one, using the same library, it says 'firewire connections not supported. Use the USB cable provided'. I am hoping there is a setting that I can flip to change this.

    No you can't - the current release of iPods only support synching through USB.
    FW accessoire can be used for battery charging only.

  • Cisco Connect not installing on OSX Lion

    I am unable to install Cisco Connect v 1.3.11006.1 for Mac under OSX Lion 10.7.0 because Lion is not in the list of supported versions of OSX. As a result, the Setup program refuses to run.
    Please can you advise when an updated Mac version of the Cisco Connect software will be released?
    Thanks,
    Daniel.

    For everyone... here is the answer..... PLEASE LISTEN...
    The software is simply a software version of the WEBLOG version.  The "CISCO CONNECT" is simply a bull **bleep** version hyped up, that has a bunch of bloat ware and that is advertised. The Weblog version, which is actually the original "online" control access, that still works, is not mentioned for some reason as a 2nd means of gaining access to your routers information.  What I didn't understand is why this web access site was not given before.  it's actually very basic.  Enter in this "http" access address:    What is funny is, Cisco is the only router provider with a software access CD, when it is not needed.  It's by far the most unsecure means of trying to access something, especially when it must always be "updated".  This Lion update situation is the most evident example that they should just stick with the online version that they still use.  So here it is.  Just go to this site::: Enter this in.... 
    192.168.1.1
    Copy and past that and push enter.  As soon as you do, you will enter the weblog.  How?  It's simple.  You access your own web through your own internet connection, so the weblog address automatically detects your cisco router and shows your your security settings.  A drop down box will appear.  No need to put in a user name,,, Keep it blank.  Then type in admin as the password.  Sometimes you won't even need to do that.  if "admin" doesn't work, type "password".  If you are not already connected via your network, then make sure that you have an ethernet connection connected from your computer to port 1, of your router, so you can set up your router correctly, and so that your computer can directly connect to the online weblog, and you can set up your connection.  I had to go online, and talk to a service rep on cisco just to get this very simple information.  I asked her "why do you guys not have this website information available just in case the software runs into issues like this," and she said, "your riight, we need to address this," and I said, " I'm addressing it right now to those of us who are spending thousands on your products and can't even use it because you guys dont support it with your software."  So I hope this helps you guys.  ..

  • How can I connect Notes to my iCloud account?

    How can I connect Notes to my iCloud account?

    Go to Settings>iCloud and turn Notes on. You need a 3G or newer iPod

  • Could not determine BW release of logical system 'BWPCLNT100

    after a BI systemcopy (production to development) we get the following
    error when we run load jobs of type "delta load". full loads work fine
    "Could not determine BW release of logical system 'BWPCLNT100'"
    even if i start the deltaload from the R/3 system with transaction RSA3
    with update mode "C" i get the same error . when i use update mode "F"
    it works fine , but that's not the thing we want.
    BWPCLNT100 is the logical system of the productive system .
    we have changed all the logical system setting to BWDCLNT100 using
    transaction BDLS and we have also changed all entries in RSBASIDOC,
    RSISOSMAP, RSOSFIELDMAP,.... .
    we have done several systemcopies in the past , they all worked fine
    and without this error. this is the first copy in BI 7.00 .
    are there any loadmodules which have to be regenerated with the new logical system name?
    thank you for your help and kind regards hannes toefferl

    Hi,
    As you said you are getting error after system copy when you are doing the delta load and full load is working fine for you.
    This mainly happens due to init disturbance in the source system.
    I would suggest you to delete the init and rerun the Init from BW once again.
    This should solve your problem.
    Thanks
    Mayank

  • My wireless keyboard no longer connects with my iMac since changing the batteries. It now shows as not connected, not paired and not configured. A friend recently connected his iPad to the iMac and since then the problem started. Any ideas to resolve this

    My wireless keyboard no longer connects with my iMac since changing the batteries. It now shows as not connected, not paired and not configured. A friend recently connected his iPad to the iMac and since then the problem started. Any ideas to resolve this?

    a friend told me that he wants my os x cd for my macbook pro to upgrade his imac.
    The discs that come with your Mac are "machine specfic" and cannot be used on another Mac.

  • Wireless network connection not showing up in network connections

    Hi, Experts,
    I recently re-image my Toshiba laptop (using window xp installation disk) due to I deleted few system files accidentally and can not boot the system up.
    Before I re-image, I have no problem to connect Fios internet. After the re-image, the wireless network connection not showing up in network connections, so I cannot set up my Fios internet. 
    How to set up the  wireless network connection that it will show up in network connections?  Thank you very much for your help. 

    Issue Resolved.  I did not turn on the wireless switch.

  • HT1338 Software Update is not finding latest release (April 3) of Java 2012 001 Update for Mac OS X Lion 10.7.3 on iMac mid-2007 that downloaded automatically on iMac mid-2011

    Software Update is not finding latest release (April 3) of Java 2012 001 Update on my iMac mid-2007, but it downloaded it automatically on my iMac mid-2011 yesterday. Both are running Mac OS X Lion 10.7.3. When I try to download the update manually from Apple on my older iMac, it downloads okay, but when I try to open the dmg file, I get a warning message saying that opening this update may make your computer LESS secure. Do you want to proceed? (I did not).
    Why would Software Update find this update and install it automatically on one iMac and not the other, if they are both running the same version of Mac OS X Lion? I checked the installed software list on my old iMac and the Java update does not appear there. Why would this update make my old iMac less secure?

    Recall that Java is not installed as part of Lion.
    You have to install it (and are asked if you want to) when you first try to run some java stuff.
    Is it possible that the iMac 2007 does not have Java yet?
    Try this: open Terminal (from Utilities) and type java -version (exactly like that, with the space before the hyphen).
    What do you get?
    Consistent with this theory is that the dmg thing gave you the warning - installing java might make your machine less secure because java is a means for bad guys to try to do bad things to your computer.
    charlie

  • Error Message "The Remote device or resourse wont accept connection, not set up to accept connection from port https"

    I get this error message when trying to open and log into an online casino "The Remote device or resource wont accept connection, not set up to accept connection from port https".
    I am on a desktop computer my connection to the net is with a USB Virgin Mobile hotspot device.
    I also have issues with some downloads not installing right for instance SKYPE wont work. If the problems are related I don't know
    Thanks

    Starting in Firefox 14, Firefox will guess an address and place it in the address bar (AutoFill feature). If you have ever connected to the site using a secure (HTTPS) connection, then Firefox will try to connect security to the address suggested by the AutoFill feature. To work around this you can:
    * Edit the address to force Firefox to interpret your entry literally. For example, if there is a trailing / you can remove it.
    * Turn off the URL bar AutoFill feature and just use the AutoSuggest drop-down.
    * Clear Firefox's memory of the site so it doesn't default to a secure connection (however, this also removes any bookmarks you have to pages on the site).
    To disable the in-address-bar autofill without losing the suggestions that appear below the bar:
    (1) In a new tab, type or paste '''about:config''' in the address bar and press Enter. Click the button promising to be careful.
    (2) In the filter box, type or paste '''autofill''' and pause while the list is filtered
    (3) Double-click '''browser.urlbar.autoFill''' to toggle it from true to false. You're done with about:config and you can close this tab.
    "Forget about this site" will clear cache, history, bookmarks, and permissions for the site, and probably any saved certificate. There are two ways to get to this:
    * History > Show All History, right-click an entry for the site > "Forget about this site"
    * Type or paste about:permissions in the address bar and press Enter, then select the site from the list on the left side, and click the "Forget about this site" button on the right side
    Depending on the size of your history and cache, this may lock Firefox up for a minute or two while everything is cleansed.

  • Purchase Order not subject to release strategy

    Good day everyone!
    I've created one release strategy for all my purchasing documents. The characteristic is net value, and the value of this characteristic is >=0.00. Meaning, ALL purchase orders are subject to release strategy.
    After I did the release strategy in SPRO, I created a few PO and when I tried to release them, I got this message: "Purchasing document 45xxxxxxxx not subject to release strategy".
    My question is: How to assign purchasing document to release strategy?
    Please help. Thank you in advance.
    Anisah

    hi
    yes you have to use table CEKKO for PO release strategy , now , in PO you can't create without clasification so it will be applicabe for whole PO not for line items ,
    now below i am giving u one by one steps , follow and let me know .
    The release code is a two-character ID allowing a person to release (clear, or approve) a requisition or an external purchasing document. The release codes is basically controlled via a system of authorizations (authorization object M_EINK_FRG).
    Use SE12, structure CEKKO to check all the fields available for controlling the Purchase Order.
    e.g. If the total value for the Purchase Order exceeds 10,000, release strategy 01 is assigned to the Purchase Order.  There is only one characteristic created in this example.  For controlling the Purchase Order type, create characteristic for CEKKO-BSTYP and the value NB.
    CT04 - Create Characteristic   e.g.  NETVALUE
    Click Additional data Table name CEKKO      Field name  GNETW    and press enter
    (for currency dependent field, you are prompt to enter the currency which the system then converts the currency of the Purchasing document into this currency)
    In the Basic data (X refers to tick),
    X    Mutliple values
    X    Interval values
    In the Value data, in the Char. value column, type >10000 and press enter
    Save your data
    CL02 - Class
    Class - Create REL_PUR
    Class type - 032
    Click Create
    Description - Release Procedure for Purchase Order
    In the Same Classification section, click Check with error
    In the Char. (characteristic) tab, type NETVALUE to assign your characteristics to the class
    OMGS - Define Release Procedure for Purchase Order Type
    Release Group - New entries
    Rel.group   Rel. Object   Class                 Description
      02                                 REL_PUR        Rel. Strategy for PO
    Release codes - New entries
    Grp         Code
    02           01
    Release indicators
    Release indicators           Release        Description
          0                                                        Blocked
          1                                     X                Release
    Release Strategy
    Release group   02
    Rel.strategy    01
    Release codes   01
    Release status   0
                            1
    Classification   Choose your check values
    OMGSCK - Check Release Strategies
    (make sure there are no error messages)
    Once the Purchase Order is not release, buyers will not be able to print the Purchase Order.
    Goods Receipts will be shown with Message no. ME 390 - Purchasing document XXXXXXX not yet released.
    In 4.6c, Purchase Order with Release Strategy have a tabs at the end of the Header.  This allowed the buyers to check the release status of the Purchase Order.
    The person with the release authorization have to use ME28 to release the Purchase Order. 
    regards
    ravikant dewangan

  • Purchase Order not subject to release strategy for contract rel. strategy

    Hello, I am trying to set release strategy for contracts (TCODE: ME31K). I have created characteristic, which use table CEKKO and field name BSTYP in Addnl data tab. I have checked values, and they are correct. Then I have assigned in release strategies in classification view value contract. But when I try to check release strategy in ME31K with green flag, it display error: Purchase Order not subject to release strategy. (I have tried to do the same strategy in purchase order, of course with value Purchase order, and it works nice).
    So I have checked this release strategy with this codes:
    CL24N ok,
    CT04 ok,
    CL30N ok,
    CL20N ok,
    Release simulation in release strategy works,
    Then I found out that I should check SE38, SE37 but I do not understand how to use them (according: Purchasing Document Not Subject to Release Strategy).
    Thank you for your help in advance.

    I haven't said to use EKPO table in characteristics. You have to use CEKKO - BSTYP in characteristics.
    I've just said the compare the value which you have given in Release strategy - Classification and EKPO table for the particular contract.
    Also compare your release strategy settings with many existing documents in SCN.
    Check your Classification should be like that.
    You may see the error message in ME31K. Just save the contract then go to ME32K/ME33K or ME35K you can see the release strategy will effect for the contract.

  • Quantity contract not relevant for release

    Hi all,
    I am working on quantity contracts. After creating a contract, I'm trying to create a release order with reference to the contract. When I fill in the contract nr and the release partner Sap gives me the following message: contract 400****** is not relevant for release, authorization check.
    Any suggestions?
    Thx

    Hi,
    In order type VOV8, there is a filed Check partner authorization under Contract.
    If it is No check, then no need to give the customer number while you release the contract.
    Here you can specify whether the check is to be performed against the partners in the contract. If you do not want the check to be performed, leave the field blank.
    Regards
    M. Lakshmi Narasimhan

  • How to fix the constant noise in the left corner of the Macbook Air which is connected not with a fan?

    How to fix the constant noise in the left corner of the Macbook Air which is connected not with a fan?

    Unfortunately if there are various colours across the screen then you have broken the LCD Screen and it will need replacing. If the colours change when you press the area lightly then this is another symptom that you've broken the screen.
    Sorry to give the bad news!

Maybe you are looking for

  • HT201412 iphone 4s apps will not reinstall on phone, stuck in waiting mode; new apps will only download if synced to itunes on PC

    A few weeks ago about 7 of my apps had updates. I pressed update all and instead of it updating them, they were frozen for several days in "waiting" mode. Finally I was tired of this so I deleted the apps by pressing one and it activated the x to pop

  • Awful experience in Apple Store...can't find how to complain

    Hi everyone. I had a terrible experience in an Apple Store tonight and I'm not sure where to go on this website to get it rectified. Maybe someone can point me in the right direction. I had a Genius Bar appt at 7:40 to look at my phone. I went around

  • Odd Airport Extreme Issues

    Hi I'm new to these discussion boards but I was wondering if someone could possibly help me with some airport issues I've been having. My roommate and I both share use an Extreme with Comcast and as far as internet goes everything is great. However o

  • Hexadecimal - Horizontal Tab

    Hi, I need to write a file as tab delimited on the application server. I've tried the following two methods to achieve this: - data: tab_hex(2) type X Value '09'. ( Can't use this as the app server is using                                            

  • Java Wireless Toolkit

    Hi everyone, i'm new in this forum and i'm from Brazil =) I'm trying to install this in my pc, but it's win98 and i didn't have success. Have anyway to install in win98, or have another toolkit that works with win98?