Significnce of making the Connection object explicitly as null

Iam using java.sql.Connection object to make connection to DB400 database and in the finally block closing the connection as con.close();
90% of the time query is executing fine and getting correct results. But some times the updated values in the data base are not getting reflected in the result set. ie: ResultSet object is not refreshing properly(not always but sometimes). After making the code in the finally block as follows I feel it is working fine
if(con != null)
con.close();
con=null;
Can some one explain the significance of making an object explicitly to null.

I am facing the same issue again. The resultSet and the stament are getting closed properly but the query is not fetching the updated results. If i execute the same query using a client(WinSQL), then the updated values are reflected. Also if i change any of the where conditions in the query(adding one more 'and' condition or 'or' condition ), then the query is giving correct results. Is there any resultSet caching occurs in websphere

Similar Messages

  • An error occured while opening the connection: Object reference not set to

    After I uninstalled Oracle Developer Tools for Visual Studio .NET 10.1.0.4 and installed Oracle Developer Tools for Visual Studio .NET with Oracle10g Release 2 ODAC 10.2.0.2.21 I got the error message below when I want to connect to my 10g database using Oracle Explorer.
    Error:
    An error occured while opening the connection: Object reference not set to an instance of an object
    I use OracleConnection to open also cannot be done. But I use Oracle SQL Developer I can connect to orcl that I cannot connect using ODAC 10.2.0.2.21 in my laptop.
    Please help me.
    Ming Man

    Sorry my mistake, I double checked, the one I uninstalled is ODAC 10.2.0.2.20 and not ODAC 10.1.0.4.
    But I have that error.
    Ming Man

  • Making the connection

    Hi,
    in this class,
    http://cid-17ec75244bac022f.office.live.com/embedicon.aspx/for^_sharing/SimpleSql.java
    I am not sure if it's making the connection properly.
    I'm making use of it in a Jdev project
    regards,
    Huamin

    user12233770 wrote:
    thanks
    in the class, it's referring to one datasource like
    javax.sql.DataSource ds
    = (javax.sql.DataSource) ctx.lookup("examples-dataSource-demoXAPool");
    How can we locate to the source amid WLS?Hmm. Are you trying to say: "How do you configure a datasource in Weblogic Server"?
    Really, if you want help, make the effort to ask a proper question, WITHOUT abbreviations :s

  • Getting the connection object in graph

    As part of Denormalizer component's Denormalize property where we have the logic of collapsing/denormalising the records we want to execute a sql query using PreparedStatement which requires Connection object.how do I get the connection object and execute a query.Can some one please share the java doc of the classes I can use.
    Do I get any class under org.jetel package which can be useful to get the Connection object.

    As part of Denormalizer component's Denormalize property where we have the logic of collapsing/denormalising the records we want to execute a sql query using PreparedStatement which requires Connection object.how do I get the connection object and execute a query.Can some one please share the java doc of the classes I can use.
    Do I get any class under org.jetel package which can be useful to get the Connection object.

  • Where to store the Connection object?

    Hi,
    I am using JDBC together with JSF technology to building web applications. I have the following questions:
    1. Where do we usually store the open Connection object so that every class in my web application can make use of it to update or retrieve database data?
    2. Since JSF uses managed-beans which is not a servlet itself, if I store the Connection object as an attribute in the application scope then it can only be retrieved from a servlet.
    3. If I make the Connection object on every class where I would like to have database access, it seems that it is not following good practice since this would create duplicate codes in every Java class which is going to have database access.
    Does anybody have an idea? Thank you.

    Hensome wrote:
    1. But how do I use the managed bean within a servlet? Could you write some simple sample codes?
    2. If I only use simple navigation rules and backing beans, when the submit button is clicked then the action method of the managed bean is triggered. I will then trigger the action which uses JDBC for database access. This whole process does not go through a particular servlet. Is this also possible? If yes, how?
    Thank you.the process does run through a particular servlet, it's the faces servlet and is defined by something that looks like
      <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>0</load-on-startup>
      </servlet> in your web.xml file. You don't have direct access to it, but you can save references to objects in the session or request so other objects can access it. Lets say that your faces code uses a DAO to read some data and you want to pass the data to a servlet, what you need to do something like:
         List data = myDAO.read();
         FacesContext facesContext = FacesContext.getCurrentInstance();
         HttpSession session = (HttpSession)facesContext.getExternalContext().getSession(true);
         session.setAttribute("myData", data);this will save the data object or list in the session as an attribute. Then, when the other servlet runs, you can do something like:
    public void doPost(HttpServletRequest request, HttpServletResponse response)
         throws ServletException, IOException {
         HttpSession session = request.getSession(false);
         Object obj  = session.getAttribute("myData");
         List myData = (List)obj;
    }          Now the servlet has access to the list of data read by the faces bean. You shouldn't directly access faces beans themselves from another servlet, you should instead access POJOs that you have defined or collections of them.

  • Populate County for Supplier Address of the Connection Object

    Hi
    Is there any way that we can populate county (Region) field for supplier address of the connection object i.e premise address (ISU) in SAP system? This is not a mandatory field hence is not filled up by customers (Business Partners).
    County here I mean is eg:
    Country is UK:
    County is Essex then Region code is "ES" etc..
    Please provide your valuable suggestions
    Note: There are billions of customers for which region needs to be populated.
    Thanks and Regards
    Ishi

    Any idea?
    I want to maintain County/Region for UK in Supplier SAP system of ISU..
    Thanks

  • Closing the Connection object

    I was looking at one of the database examples in a Java book I recently purchased. In their example they establish the connection in the class with the main. ( is this referred to as the Moment Interval? ) Anyway, they pass the private Connection connection object to another class called AddRecord which implements an ActionListener. In this class, the AddRecord Constructor changes the name to con which is also declared as private in this class. What they don't show is how to close the connection object now that it has a new name. How do I close the connection object.
    The example is using an Access mdb and when the appication is closed, the Access.ldb file is still there.
    Is there a better solution?
    Thanks everyone,
    Leo D.

    I'm sorry. I meant to say "Where" do I close the connection? If I close the connection in the AddRecord Class, then I won't be able to add another record. And I can't close the connection in the moment interval because I've declared the connection object in class AddRecord as Private. Should I give the connection object package access?
    Thanks,
    Leo D.

  • Probem in creation of the connection object

    Hi All,
    We have deployed a e-billing application, with Weblogic 8.1 (SP 2) being used as the Application Server.
    When we try to login with a valid userid existing in the database, initially it works fine for 2-3 attempts, but after this when we try again, it fails to login and in the background we are getting the error:
    weblogic.transaction.internal.ResourceAccessException: Transaction has timed out when making request to XAResource 'weblogic.jdbc.wrapper.JTSXAResourceImpl'.
         at weblogic.transaction.internal.XAResourceDescriptor.startResourceUse(XAResourceDescriptor.java:610)
         at weblogic.transaction.internal.XAServerResourceInfo.start(XAServerResourceInfo.java:1074)
         at weblogic.transaction.internal.XAServerResourceInfo.xaStart(XAServerResourceInfo.java:1007)
         at weblogic.transaction.internal.XAServerResourceInfo.enlist(XAServerResourceInfo.java:203)
         at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:419)
         at weblogic.jdbc.jts.Driver.createLocalConnection(Driver.java:207)
         at weblogic.jdbc.jts.Driver.connect(Driver.java:154)
         at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:305)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at weblogic.ejb20.manager.BeanManagedPersistenceManager.scalarFinder(BeanManagedPersistenceManager.java:81)
         at weblogic.ejb20.manager.BaseEntityManager.scalarFinder(BaseEntityManager.java:1580)
         at weblogic.ejb20.manager.BaseEntityManager.remoteScalarFinder(BaseEntityManager.java:1514)
         at weblogic.ejb20.internal.EntityEJBHome.finder(EntityEJBHome.java:553)
         at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:166)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:284)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:400)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    This was the initial error that we used to get but then the error message was different (I am not sure about the reason for the change in error message)
    <Exception>java.rmi.RemoteException: javax.ejb.EJBException: Error looking up connection: java.sql.SQLException: No JDBC connection can be made
    because the transaction state is
    Marked Rolledback</Exception>
    The problem (so far I could get it) is happening when the connecion class is being instantiated by the datasource API:
    DataSource ds = null;
    Connection conn = ds.getConnection();
    conn.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
    return conn;
    Any suggestions to the following problem will be of great assistance.
    Thanks & Regards
    Neeraj Kanodia

    Hi,
    I think that this XAER_RMERR is not from Oracle driver; instead the weblogic transaction manager itself throws it. The sequence is like this:
    - At some point in the transaction, a new sql is to be executed.
    - The DataSource manager (of weblogic) gets the XAResource of the connection and tries to enlist that with current transaction.
    - At the point, transaction manager detects that the transaction already timed out (JTA timeout) and marked for rollback.
    - The transaction manager throws XAException with error code set to XAER_RMERR, which you see in the stack trace.
    It does not look like a real issue except the fact that the transaction has timed out which of course can happen if the transaction is running for long time. I suspect that sometimes this problem may lead to connection leak also. And I found some known issues on this exception, to confirm that I would like to have a look in to your log file. Kindly provide me the log file, which contains this exception.
    Regards
    Anilkumar kari

  • Having the connection object for the specific schema

    hi
    My application interacting with the database of having many no of schema's. I need to create a connection object which is pointing to the specific schema in my database. This is help me to avoid writing schema name in the query every time.
    Thanks
    Siva

    How to specify the schema name in properties file?
    Say for example, i created properties file like that,
    Properties props = new Properties();
    props.setProperty("user", "username");
    props.setProperty("password", "password');
    In which property i can set for schema?

  • How to retreive String from the Connection object

    hi all,
    I am using HttpConnection to Connect to the server.I want to retreive string from the Connection.
    As like Connection.openInputStream() is there any method to get the String from the connection.In the server side also i want to send the String not the stream .
    Thanks in advance
    lakshman

    Just read the string from the stream.

  • Making the connections between AD and iTunesU

    Folks,
    I'm not a programmer and don't know the first thing about getting the scripting to work properly. We are an ASP.Net place as well as some ColdFusion users. Any chance somebody has made authentication work with either of these two languages and could help me get the ball rolling?
    hehe, I don't even know how to login into the stupid thing. I feel like George Jetson....

    iTunes U works quite nicely with ColdFusion. Information for your developers:
    ColdFusion does not support the Java byte type. Make these changes to the ITunesU.class provided by Apple:
    line 90, change:
    public String hmacSHA256(String message, byte[] key) {
    to:
    public String hmacSHA256(String message, String secret_key) {
    byte[] key = secret_key.getBytes();
    line 251, change:
    Date time, byte[] key) {
    to:
    Date time, String secret_key) {
    byte[] key = secret_key.getBytes();
    line 281 change:
    String signature = this.hmacSHA256(buffer.toString(), key);
    to:
    String signature = this.hmacSHA256(buffer.toString(), secret_key);
    line 308, change:
    Date time, byte[] key) {
    to:
    Date time, String secret_key) {
    byte[] key = secret_key.getBytes();
    line 332, change:
    buffer.append(this.hmacSHA256(data, key));
    to:
    buffer.append(this.hmacSHA256(data, secret_key));
    line 526, change:
    now, key);
    to:
    now, sharedSecret);
    compile from the command line: javac ITunesU.class
    for ColdFusion:
    (get createJavaObject from cflib.org and it include it in your cfml)
    your code (basiclly):
    <cfset secret_key = "STRINGOFTHIRTYTWOLETTERSORDIGITS">
    <cfset epoch_time=LSNumberFormat((createobject("java", "java.util.Date").getTime()) / 1000, "_")>
    <cfset cred_admin = Replace(URLEncodedFormat("Administrator@urn:mace:itunesu.com:sites:YOURSCHOOL.e du", "utf-8"), "%2E", ".", "all")>
    <!--- form.uid is from your login form that submits here --->
    <cfset ident = Replace(Replace(URLEncodedFormat('"#fullname#" <#form.uid#@YOURSCHOOL.edu> (#form.uid#)', "utf-8"), "%20", "+", "all"), "%2E", ".", "all")>
    <cfset tokenData_admin = 'credentials=#credadmin#&identity=#ident#&time=#epochtime#'>
    <cfset loader = createJavaObject("./")>
    <cfset ITunesU = loader.loadClass("ITunesU").newInstance()>
    <cfset signature_admin = ITunesU.hmacSHA256(tokenDataadmin,secretkey)>
    <cfset site_url = "https://deimos.apple.com/WebObjects/Core.woa/Browse/YOURSCHOOL.edu">
    <cfset debug_url = "https://deimos.apple.com/WebObjects/Core.woa/Browse/YOURSCHOOL.edu/YOURDEBUGST RING">
    <cfoutput><xa href="#siteurl#?#tokenData_admin#&signature=#signatureadmin#">administrator login</xa><xbr>
    <xa href="#debugurl#?#tokenData_admin#&signature=#signatureadmin#">administrator debug</xa>
    </cfoutput>
    (xa xbr are to stop Apple's forum from redering them as HTML)
    There is plenty of documentation on how to auth ColdFusion against Active Directory. Basically, you use a <cfldap> tag and modify the attributes, scope, etc for you particular environment.
    Hope this helps. It should give you pretty much all you need to get up and running with ColdFusion/iTunes U.
    -qk.

  • Connection object is getting closed before the stored procedure is complete

    Hi Everyone,
    I am facing an issue where by the java connection object is closed before the stored procedure it is connected to is complete.
    I am not sure if the fault is in SP or Connection pool.
    After spending some time, i could able to figure out that the procedure is taking a tad more time for processing as there are over 1000 records in the database tables it is dealing with.
    Would that be a potential cause ? or Am i required to handle it in Java only ?
    I want to know what could be possible causes for this issue ?
    Please Help.
    FYI,
    The following are the logs which says,
    XYZ (Stored Procedure) : Start Time is 1349217771302 Procedure started here
    INFO >2012-10-02 18:43:09,935 [ConnectionPool]: Closing connection: DataSource [ABC](684)
    INFO >2012-10-02 18:46:03,512 DAO[main]: XYZ : End Time is 1349217963512 Procedure ended here
    Thanks in Advance.

    Hi ,
    Thank you all for your quick response.
    Well it's my bad i dint provide you any code to look into thinking that i am dealt with a gen issue and also i am too paranoid to post any code i am dealing with in the forum (i am sorry).
    But here is some information for you,
    Database : Oracle 10g
    Java: 1.5 version
    We are using only One connection object for the entire java backend process .
    The SP is of over 1000 lines of code which for obvious reasons i can't past it here but this morning i figured out an issue in SP where by a query taking way more than usual time to execute which led to SP's poor performance and also the reason for why it is taking very long time than usual.
    This query is a simple SELECT query where it is trying fetch over 2000 records from a table of over 3 million records. The execution time is over 30-40 seconds which is the root cause of SP's poor performance.
    When i eliminated this from the logic and ran the query it could able process (inserting huge volume around 5000 records of data) in 1 second instead of 3-4 minutes earlier.
    I tried to replicate this issue (which occurred in our production server) in my local system but no luck as there was no connection issue here but only the substantial time difference.
    We are using a customized connection pool which is as follows,
    I am not sure what's going on here because it seems to be greek and latin to me.
    What we are doing in our DAO is we are using method of the below ConnectionPool.getInstance(SCHEMA) to get the connection object.
    Looking forward to seeking advice from you on how connection pool in general works.
    public class ConnectionPool extends Thread
         private static final ConnectionPool me = new ConnectionPool();
         private Hashtable dataSources = new Hashtable();
         private static final int MIN_TIMEOUT = 0;
         private long timeOut;
         private Hashtable cons = new Hashtable();
         private Hashtable active = new Hashtable();
        private boolean trace = false;
         private ConnectionPool()
              registerDataSources();
              this.timeOut = PropertyManager.getIntProperty("connectionPool.timeOut", MIN_TIMEOUT);
              setName("ConnectionPool");
              setPriority(MIN_PRIORITY);
              if (timeOut > 0)
                   start();
         private void registerDataSources()
            dataSources.clear();
              Properties props = System.getProperties();
              String app = props.getProperty("X", "Y");
              for(Enumeration e = props.keys(); e.hasMoreElements();)
                   String key = (String) e.nextElement();
                   if (key.startsWith(app + ".connectionPool.dataSources.") && key.endsWith(".selector"))
                        String ds = key.substring((app + ".connectionPool.dataSources.").length(), key.length() - ".selector".length());
                        LogManager.logStatus("Registering [" + ds + "] (selector) " +
                                  props.getProperty(app + ".connectionPool.dataSources." + ds + ".selector"));
                        dataSources.put(ds,
                             new GenDataSource(
                                  ds,
                                  props.getProperty(app + ".connectionPool.dataSources." + ds + ".selector")));
                        continue;                    
                   if (!key.startsWith(app + ".connectionPool.dataSources.") || !key.endsWith(".server"))
                        continue;
                   String ds = key.substring((app + ".connectionPool.dataSources.").length(), key.length() - ".server".length());
                   try
                        LogManager.logStatus("Registering [" + ds + "] " +
                                  props.getProperty(app + ".connectionPool.dataSources." + ds + ".url"));
                        loadDriver(props.getProperty(app + ".connectionPool.dataSources." + ds + ".driver"));
                   catch (Exception se)
                        LogManager.logException(se);
                   GenDataSource genDataSource = new GenDataSource(
                             ds,
                             props.getProperty(app + ".connectionPool.dataSources." + ds + ".useMatrix", "false").equals("true"),
                             props.getProperty(app + ".connectionPool.dataSources." + ds + ".server"),
                             props.getProperty(app + ".connectionPool.dataSources." + ds + ".url"),
                             props.getProperty(app + ".connectionPool.dataSources." + ds + ".user"),
                             props.getProperty(app + ".connectionPool.dataSources." + ds + ".password"));
                   // Set the schema if schema is defined in settings.xml file
                   if (genDataSource != null && props.getProperty(app + ".connectionPool.dataSources." + ds + ".schema") != null ) {
                        genDataSource.setSchema(props.getProperty(app + ".connectionPool.dataSources." + ds + ".schema"));
                   dataSources.put(ds, genDataSource);
         public static Connection getConnection(String dataSource) throws SQLException
              GenDataSource ds = (GenDataSource) me.dataSources.get(dataSource);
              if (me.timeOut <= 0)
                   if (ds.getSchema() != null )
                        return updateSchema ( ds);
                   else
                        return DriverManager.getConnection(ds.url(), ds.user(), ds.password());
              String key = dataSource;
              Stack free;
              GenPooledConnection pc = null;
              synchronized (me)
                   if ((free = (Stack) me.cons.get(key)) == null)
                        free = new Stack();
                        me.cons.put(key, free);
                   if (!free.empty())
                        pc = (GenPooledConnection) free.pop();
                   if (pc == null)
                        if (ds.getSchema() != null )
                             pc = new GenPooledConnection("DataSource [" + key + "]",
                                                 updateSchema ( ds), free, me.active, me.timeOut, me.trace);
                        else
                             pc = new GenPooledConnection("DataSource [" + key + "]",
                                       DriverManager.getConnection(ds.url(), ds.user(), ds.password()), free, me.active, me.timeOut, me.trace);
                   else
                        pc.touch();
              LogManager.logStatus("Using " + pc);
              me.active.put(pc.id(), pc);
              return pc;
         public void run()
              for(;;)
                   try
                        sleep(60 * 1000);
                        synchronized (me) {
                             for(Enumeration e = cons.elements(); e.hasMoreElements();)
                                  Stack stack = (Stack) e.nextElement();
                                  for (int i = stack.size()-1; i >= 0; i--)
                                       GenPooledConnection pc = (GenPooledConnection) stack.elementAt(i);
                                       if (pc.isExpired())
                                            stack.removeElementAt(i);
                   catch (Exception e)
                        GenUtil.reportException(e);
         private static Connection updateSchema ( GenDataSource ds) throws SQLException {
              Connection con = DriverManager.getConnection(ds.url(), ds.user(), ds.password());
              if (ds.getSchema() != null ) {
                   String sql = "SET SCHEMA  " + ds.getSchema()+ ";";
                   LogManager.logDebugMessage("updating the Schema with sql statement " + sql);
                   PreparedStatement ps = con.prepareStatement(sql);
                   ps.execute();
                   ps.close();
              return con;
    }Thanks.
    Edited by: EJP on 5/10/2012 14:09: added {noformat}{noformat} tags. Please use them.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Programmatically retrieving the DeviceNet "Connection" object in LabVIEW (like SimpleWho can)

    I can already get all of the "Identity" object attributes, but how does one get the "Connection" object attributes?
    Specifically, I would like to get the poll input/output lengths so I can set up an I/O connection.  It looks like SimpleWho can get this info without actually opening the connection.  Is this possible from within LabVIEW?

    Hi,
    The new driver version 1.5 brings some new examples and one of them creates  a device list. Perhaps this is something helps you with your problem?
    her is the Link for the driver:
    NI-Dnet1.5
    DirkW
    Attachments:
    GetDeviceList.llb ‏99 KB

  • Advantages of connection object

    Could someone explain the advantages or rather difference in passing the Connection object from a JSP to a servlet instead of creating one (and returning to the pool) in the servlet itself?
    Thanking you

    Do you mean the advantage of holding onto a connection over multiple requests versus making a new one each request?
    There it usually comes down to 2 things:
    1) Faster response time if new connections don't have to be made, or you don't have to wait for another connection to be freed for the pool
    2) Probably more importantly you can maintain multi-request transactions. If you have a transaction with the DB that may take several steps of user interaction, if you maintain the same connection then if you need to you can roll back all the changes (cancel) that the user made. If you make/get new connections each time then it is harder to roll back and you could leave the DB in an unwanted state.
    If you mean in the same request... then I don't know - other than it is easier to handle all the exceptions in a servlet then in a JSP (nature of working with Java code directly)

  • SAP_PROXY_ESR: Problem with the 'Connection Test' on transaction SM59

    Hi,
    I have a problem when eject the 'Connection Test' command on Transaction SM59.
    I made the RFC Destination SAP_PROXY_ESR with:
    Technical Settings
    Conection Type: G
    Target Host: my_host
    Path Prefix: /rep
    Service No: 1080
    Logon Security
    Basic Authentication: X
    SSL: Inactive
    SSL Client Certificate: DFAULT SSL CLIENT (Standard)
    User: ers_user
    Password: ers_password
    Especial Option
    No Time Out: X
    HTTP Version: HTTP 1.0
    Compression: Inactive
    Compressed Response: YES
    Accept Cookies: NO
    I completed the transaction SPROXSET with:
    IFR_ADDRESS             ESR_USER     http://my_host:1080/rep
    IFR_PASSWORD     ESR_USER     esr_password
    IFR_USER             ESR_USER     ESR_USER
    In the transaction SM59 (RFC Destination SAP_PROXY_ESR) I'm making the 'Connection Test' but this command give the Message: ICM_HTTP_CONNECTION_FAILED.
    In the program SPROX_CHECK_IFR_ADDRESS
    Message: 'Cannot determine repository version'
    Log_1- No vendor specified
    Log_2- No vendor specified
    I don't know the reason of this messaje.
    I tried change the Service No. with others Ports but, the error is the same everytime.
    Can anyone help me please?
    NOTE: In my landscape, i dont have the Stack JAVA installed.
    Thanks and Regards

    But the Enterprise Services Repository is Java.
    the /rep points to the folder of the Repository.
    the ESR is part of SAP PI or CE.

Maybe you are looking for