Jdbc connection set source ip address

Hi
Is there any way to specify the local (source) ip address of a jdbc connection ?
I work in an enterprise environment with firewalls all over, and only certain ip addresses can connected to other ip addresses.
The server which runs my application has many ip addresses and
I'd like to be sure that my ip address is the source...
Thanks
Gabor Dolla
Budapest, Hungary

No, certainly not in the JDBC API. I don't believe there's even a way to do this in the java.net Socket API. There's the very slimmest of slim chances that a particular driver might implement something like this, in which case it would be in the driver's documentation. However, the chances are so slim that I'd bet strongly against any driver doing this.
The source address is usually picked by the operating system, based on the routability to the target IP address. Basically, the OS network services looks at the target IP and says to itself, "which (logical) interface can get there? That's the source IP I will use". If your host's routing says there are multiple routes to the IP, then it will pick one; if there's only one route to the particular IP, there will be only one interface (and therefore source IP) that can be chosen.
There's no reason Java or a driver couldn't be extended to do this, but no particular demand either; the problem is usually dealt with at the network layer.

Similar Messages

  • How to set roles from JDBC connections

    Hi guys,
    I have a jdbc connection which purpose is to run queries based on a string that I construct in my program.
    My question is: if I have to run a DCL, like: SET ROLE RL_XXX TO USER1;
    What's the easiest way to do it with my same connection?
    Thanks.

    Hi Marc,
    Sorry for the typo. It's a BDC source, I use a WCF client to access a SQL Database (HR External System) that has 4 fields that are necessary to present in the Sharepoint User Profile. The issue occurs with a Full or a Delta Sync. The problem is that if the
    BDC source is not present the fields are deleted (I get a SPS-Dummy Added and all of the pbjects in the BDC Connector Space are deleted).
    I do not want this to happen. I do not want the User Profile Attributes/Fields to be empty/deleted if there is no connection I simply want them to stay what they are... I have two issues.
    1) Is that the even if i change my data on SQL Server side, the changes do not get picked up by the sync. Since the only field that is being tested for change is an ADid, since the id does not change the BDC does not consider them changes.
    2) If there is no connection I do not want the attributes to be deleted. I have not figured out a way to effectively do this.
    So my issue appears to be simple to solve, but after 4 days and hundreds of tutorial pages read I have yet to figure out a proper way to do this.
    Here is the pseudo-specification
    The Fields that come form the HR System (SQL Server) are to be presented in the user profile. If there is no connection to the BDC file the fields remain as they are until there is a connection and updates can be made. Changes to any of the fields are performed
    manually in the HR system. These changes must be picked up by the daily sync.

  • Is there any way to set read timeout on JDBC connection?

    When the network connectivity between the machine
    where Database is running and where the application is running breaks,
    the query executed using the old connection handle is not timing out.
    Is there any way to set read timeout on JDBC connection. ?
    FYI, Oracle JDBC thin Driver is used in our application.

    Set the tuning parameters with Embedded OC4J Server Preferences>Current Workspace>Data Sources>jdev-connection-DBConnection1 node.
    Select the Tuning tab.
    The Inactivity Timeout parameter specifies the number of secs of inactivity after which a connection gets disconnected.

  • Set up MAC Address Filtering on WRT54G - now nothing connects

    I set up MAC address filtering on the wireless router.  Added 5 MAC addresses to the PERMITTED list, by selecting them from the available devices.   Saved the changes.  Now, none of the machines can connect to the access point.  That includes the PC I use to log in and administer the access point.  I connected the network cable directly to my PC to manage the router/access point.  Still not able to connect.  What happened?  How do I get back in and turn that nonsense off.  I know MAC Filtering is questionable wrt effectiveness, but I decide to try it.
    Solved!
    Go to Solution.

    Reset the router back to defaults. Reconfigure it from scratch.

  • Log connection attempts and source IP address for connections that fail/timeout on RADIUS

    How can I log the connection attempts and source IP address for connections that fail RADIUS authentication?  I'm using RD Gateway on 2012 R2 in conjunction with Azure Multi-Factor Authentication Server on another 2012 R2 server.  When a user fails
    multifactor authentication or the authentication times out, all I get is Security event 6273 on the RD Gateway that the radius server did not process the request, and only the radius server's IP is logged.  There's nothing logged in TerminalServices-Gateway\Operational
    because the TS Gateway hasn't yet processed the connection attempt (all auditing options for RD Gateway are enabled).  The MFA/Radius Server is only logging the connection from the TSGateway - it doesn't know the original client's IP address.
    I'm looking for the equivalent of an IIS log - somewhere the RD Gateway should log the initial HTTPS connection attempt and the source IP address of the client.  I need to be able to track down potentially fraudulent login attempts. 

    Hi,
    Thank you for your posting in Windows Server Forum.
    This error might be caused by one of the following conditions:
    •  The user does not have valid credentials
    •  The connection method is not allowed by network policy
    •  The network access server is under attack
    •  NPS does not have access to the user account database on the domain controller
    •  NPS log files or the SQL Server database are not available
    To perform these procedures, you must be a member of Domain Admins.
    Please check for more information:
    Event ID 6273 — NPS Authentication Status
    http://technet.microsoft.com/en-us/library/cc735399(v=ws.10).aspx
    Hope it helps!
    Thanks.
    Dharmesh Solanki

  • The maximum number of connections per source ('20') for this connector has been reached by this source IP address

    Receive connector 'Connector Name' rejected an incoming connection from IP address "IP of our load balancer". The maximum number of connections per source ('20') for this connector has been reached by this source IP address.
    I understand that I can up the limit - however, I'm wondering if there is a way to up the limit for ONE specific IP (our load balancer)
    TAG

    It does not look like you can up the limit for a specific IP but you might be able to create a separate receive connector for that IP address (and then change the limit).
    That is just a thought. Others may have more input on why you may or may not want to do that in practice.
    What SMTP traffic would not be coming from the load balancer?
    Is the objective to *not* allow some other (possibly malicious) source from creating excessive connections to the server?
    Otherwise, this is a good discussion about the different parameters that must be considered if you do decide to adjust the values (changing one may not suffice):
    http://letsexchange.blogspot.com/2012/04/receive-connector-rejected-incoming.html
    Nuno Mota's blog (MVP)
    Please mark as helpful if you find my contribution useful or as an answer if it does answer your question. That will encourage me - and others - to take time out to help you.

  • Can we set an Alert  for JDBC Connection Failures ?

    Hi friends ,
                      Can we set an alert for JDBC Connection failure as mail as well as Alert ?
                      I am using JDBC Sender adapter to read the data from sql server table.
                      I am not using BPM .
                      I want to set an alert and mail to respective person when JDBC Connection failure .
                      If XI trying to read a database if  connection failure or connection properties lost it won't come ti Integration engine itself  right ?
                     I assume as we have to set alert at system level .
                    Can you please give me the step by step details  to set this kind of alerts ?    
                      Expecting your reply asap .
    Best Regards.,
    V.Rangarajan

    Renga rajan,
    This is what I tried to explain in yuor previous threads.
    >>>If XI trying to read a database if connection failure or connection properties lost it won't come ti Integration engine itself right ?
    In such cases, you will get <b>an error at adapter level</b> and the msg wont come into IE.
    >>>I assume as we have to set alert at system level .
    If you are above SP 14 in XI3.0, then you can raise alerts for adapter errors also.
    No special config required for this.
    To understand this, give it a try and you will get the concept.
    Regards,
    Jai Shankar

  • Set JDBC connection properties somewhere?

    Hi:
    I have BI Publisher 10.1.3.4 in Oracle WLS 10.3.3 and I'm using JDBC connections to get the report data. I'd like to set up the JDBC properties so that they encrypt things (and doing it here would mean no SSL database connection setup, no wallets, etc.) Where would I set these values (e.g. SQLNET.ENCRYPTION_CLIENT, SQLNET.ENCRYPTION_TYPES_CLIENT, SQLNET.CRYPTO_CHECKSUM_CLIENT, SQLNET.CRYPTO_CHECKSUM_TYPES_CLIENT).
    If I can't do it in BI Publisher somehow, perhaps it is possible (or desirable?) to do it in the WLS connection pool properties somehow?
    Thanks.

    FYI - this information can be entered via the weblogic server db connection pool creation wizard.

  • JDBC Connections showing IP Address instead of Hostname

    We have recently installed BEA WebLogic Integration 8.1 with SP4. Our first implementation of BEA WebLogic Server was with 6.1 with SP3. The JDBC Datapool connections to our SQL Server showed the Hostname of the physical machine the BEA Server was on, in addition to the application it was using to connect with. The current implementation of 8.1 with SP4 shows the IP address instead of the Hostname and DOESN'T show the application that is being used to connect with. Is there any way to force it to show the hostname and the application it's using to connect to the SQL server via the JDBC connection pool?

    Laurence Rooks wrote:
    We have recently installed BEA WebLogic Integration 8.1 with SP4. Our first implementation of BEA WebLogic Server was with 6.1 with SP3. The JDBC Datapool connections to our SQL Server showed the Hostname of the physical machine the BEA Server was on, in addition to the application it was using to connect with. The current implementation of 8.1 with SP4 shows the IP address instead of the Hostname and DOESN'T show the application that is being used to connect with. Is there any way to force it to show
    the hostname and the application it's using to connect to the SQL server via the JDBC connection pool?Hi. Please show me the definition of the pool in your 81sp4 config.
    thanks
    Joe

  • Generic JDBC connection not setting up.

    Hey ..
    I am trying to make a Generic JDBC connection in DB adapter. For the steps I am refering to this blog: https://blogs.oracle.com/middleware/entry/configuring_mssql_with_soa_suite
    so I went as follows: step 3 of 4 of adapter configuration > create new connection > Driver class: new > Library: Browse
    chose the driver source .jar, put the correct URL & tested the connection.
    The Error that came said:
    "Test failed: Driver class not found.
    Verify the Driver location"
    I tried same thing with sqljdbc.jar - the file used in the blog ... Same error was there.
    What's the mistake? What should I try to do?

    The problem got solved ..
    Actually the path was correct but the driver class name was wrong ..
    Perhaps it tries to find the driver class with the specific name in specified .jar
    I thought we are CREATING new thing ..
    Thanks anyways for your help

  • CR4E - JDBC Connection Properties - How do I set GenericJDBCDriver to Yes

    Hi,
    I need to setup my JDBC connection in CR4E like I would in my CRConfig.xml
    For example, I need to add this to my connection properties:
    <GenericJDBCDriver>
      <Option>Yes</Option>
      <DatabaseStructure>catalogs,schemas,tables</DatabaseStructure>
      <StoredProcType>Standard</StoredProcType>
      <LogonStyle>SQLServer</LogonStyle>
    </GenericJDBCDriver>
    Without setting these properties for my JDBC connection things do not work. I guess I need to use the Optional properites, but I do not know what the syntax would be for what I want.
    Please help.
    Thanks,
    Nick

    Please find below an example of setting the JDBC tags for Ms Sql 2000 (sp4)
    <JDBC>
         <CacheRowSetSize>100</CacheRowSetSize>
         <JDBCURL>jdbc:microsoft:sqlserver://vm-5akouassiwk2:1433</JDBCURL>
         <JDBCClassName>com.microsoft.jdbc.sqlserver.SQLServerDriver</JDBCClassName>
         <JDBCUserName>sa</JDBCUserName>
         <JNDIURL></JNDIURL>
         <JNDIConnectionFactory></JNDIConnectionFactory>
         <JNDIInitContext>/</JNDIInitContext>
         <JNDIUserName>weblogic</JNDIUserName>
         <GenericJDBCDriver>
              <Option>No</Option>
              <DatabaseStructure>catalogs,tables</DatabaseStructure>
              <StoredProcType>Standard</StoredProcType>
              <LogonStyle>SQLServer</LogonStyle>
         </GenericJDBCDriver>
    </JDBC>

  • PowerShell: How do I reliably set the IP address on an interface when the interface is not connected ?

    Hello all,
    I am in a bit of a bind - no pun intended.  I would like to know how to reliable set the persistent IP address of an interface that may be disconnected when the address is set.  I can set an address and it will be stored in the ActiveStore but
    that does not really help if I need it next time I reboot.  I have tried using netsh and WMI but they don't seem to create a persistent address on the disconnected interface.  Now if I us ncpa.cpl I can do it all day long so it must be possible.
     In fact if I do it that way the registry settings change. So, I figured I would go that route (modifying the registry) but, alas, that does not work either - upon reboot the address shown in the interface properties show a blank IP address, gateway,
    and netmask.  It is interesting that it is using a static address though. 
    Thanks for your help
    Robert
    Robert Thompson

    Look in the Gallery for numerous examples of setting a static address on an interface.
    http://gallery.technet.microsoft.com/site/search?query=static&f%5B2%5D.Value=static&f%5B2%5D.Type=SearchText&f%5B0%5D.Value=networking&f%5B0%5D.Type=RootCategory&f%5B0%5D.Text=Networking&f%5B1%5D.Value=clientside&f%5B1%5D.Type=SubCategory&f%5B1%5D.Text=Client-Side%20Management&ac=2
    ¯\_(ツ)_/¯

  • Tracing TCP Source/Destination Addresses/Ports for ongoing connections

    On Solaris 10 U4 through U7, I'm trying the following just to perform basic tracking of TCP source/destination addresses and ports, using code similar to what is available in tcpsnoop_snv and tcptop_snv.
    The odd thing is that the addresses/ports appear to be zeroed out - are they being cached outside of the conn_t data structure?
    #!/usr/sbin/dtrace -Cs
    #pragma D option switchrate=10hz
    #pragma D option bufsize=512k
    #pragma D option aggsize=512k
    #include <sys/file.h>
    #include <inet/common.h>
    #include <sys/byteorder.h>
    #include <sys/socket.h>
    #include <sys/socketvar.h>
    /* First pass, for all TCP Read/Write actions, collect source/destination
       IP + Port - after a few secs, print them all out */
    fbt:ip:tcp_send_data:entry
      /* Outgoing TCP */
      self->connp = (conn_t *)args[0]->tcp_connp;
    fbt:ip:tcp_rput_data:entry
      /* Incoming TCP */
      self->connp = (conn_t *)arg0;
    fbt:ip:tcp_send_data:entry,
    fbt:ip:tcp_rput_data:entry
    /self->connp/
      /* fetch ports */
    #if defined(_BIG_ENDIAN)
      self->lport = self->connp->u_port.tcpu_ports.tcpu_lport;
      self->fport = self->connp->u_port.tcpu_ports.tcpu_fport;
    #else
      self->lport = BSWAP_16(self->connp->u_port.tcpu_ports.tcpu_lport);
      self->fport = BSWAP_16(self->connp->u_port.tcpu_ports.tcpu_fport);
    #endif
      /* fetch IPv4 addresses */
      this->fad12 =
        (int)self->connp->connua_v6addr.connua_faddr._S6_un._S6_u8[12];
      this->fad13 =
        (int)self->connp->connua_v6addr.connua_faddr._S6_un._S6_u8[13];
      this->fad14 =
        (int)self->connp->connua_v6addr.connua_faddr._S6_un._S6_u8[14];
      this->fad15 =
        (int)self->connp->connua_v6addr.connua_faddr._S6_un._S6_u8[15];
      this->lad12 =
        (int)self->connp->connua_v6addr.connua_laddr._S6_un._S6_u8[12];
      this->lad13 =
        (int)self->connp->connua_v6addr.connua_laddr._S6_un._S6_u8[13];
      this->lad14 =
        (int)self->connp->connua_v6addr.connua_laddr._S6_un._S6_u8[14];
      this->lad15 =
        (int)self->connp->connua_v6addr.connua_laddr._S6_un._S6_u8[15];
    /* At this point, this->{f|l}ad1{2345}->connua_v6addr.connua_{f|l}addr._S6_un.S6_u8
        are empty - where is this data? */
    }

    http://www.cisco.com/en/US/docs/app_ntwk_services/data_center_app_services/css11500series/v7.50/command/reference/CmdGrpC.html#wp1139667
    portmap [base-port base_number|disable|enable|number-of-ports number|vip-address-range number]
    disable
    Instructs the CSS to perform Network Address Translation (NAT) only on the source IP addresses and not on the source ports of UDP traffic hitting a particular source group. This option does not affect TCP flows.
    For applications with high-numbered assigned ports (for example, SIP and WAP), we recommend that you preserve those port numbers by configuring destination services in source groups. Destination services cause the CSS to NAT the client source ports, but not the destination ports.
    Note If you disable flows for a UDP port using the flow-state table and configure the portmap disable command in a source group, traffic for that port that matches on the source group does not successfully traverse the CSS.
    The CSS maintains but ignores any base-port or number-of ports (see the options above) values configured in the source group. If you later reenable port mapping for that source group, any configured base-port or number-of ports values will take effect. The default behavior for a configured source group is to NAT both the source IP address and the source port for port numbers greater than 1023.
    There is no possibility to disable it for TCP.
    We need to source nat the port to guarantee that the server response comes back on the same module/CPU and the internal packet allocation algorithm is based on src and dst ports.µ
    Gilles:

  • JDBC Connectivity - broken pipe received when SQL server resets the connect

    Hi,
    We have downloaded MICROSOFT SQL SERVER 2000 DRIVER for UNIX boxes
    when i try to connect using JDBC , with all parameters
    user id, driver, password etc
    at the sniffer(TCPIP) level when the jdbc connection is attempted
    i see a
    1) SYN packet to the SQL server from unix box
    2) ACK SYN from the SQL server to unix box
    3) ACK from unix box to server
    4) no activity for about a minute
    5) a RST( reset ) from SQL server to unix box.
    at this point i get the following
    stack trace
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Broken pipe or
    no reader on socket
    at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source
    at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
    at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
    at com.microsoft.jdbc.sqlserver.tds.TDSLoginRequest.submitRequest(Unknow
    n Source)
    at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Sou
    rce)
    at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown S
    ource)
    at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
    at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(DriverManager.java, Compiled Cod
    e)
    at java.sql.DriverManager.getConnection(DriverManager.java, Compiled Cod
    e)
    at wu.database.WUDBAccess.getGiftGramConnection(WUDBAccess.java, Compile
    d Code)
    at wu.util.GiftMailClient.ConnectToDB(GiftMailClient.java, Compiled Code
    at wu.util.GiftMailClient.ProcessEmail(GiftMailClient.java, Compile
    the sniffer trace
    Frame source = (Network)
    Length = 66
    Time received = 09/24/2002 21:19:42.543
    Frame Relay
    Header = 1041
    0001 00.. 0100 .... = DLCI 68
    .... ..0. .... 000. = (Command)
    EtherType = 0800 IP
    Internet Protocol (IP)
    Source address = unix_server
    Destination address = SQL_server
    Type of service = 00
    Length = 60
    Identification = 58024
    Flags = 0000 (May fragment, Last fragment)
    Time to live = 28
    Protocol = 6 TCP
    Transmission Control Protocol (TCP)
    Source Port = 2175
    Destination Port = 8072
    Sequence = 2690569244
    Acknowledgement = 0
    Flags = 02 (SYN)
    Window size = 8192
    ============================= Frame Number 7 =============================
    Frame source = (User)
    Length = 66
    Time received = 09/24/2002 21:19:42.544
    Frame Relay
    Header = 1041
    0001 00.. 0100 .... = DLCI 68
    .... ..0. .... 000. = (Command)
    EtherType = 0800 IP
    Internet Protocol (IP)
    Source address = SQL_server
    Destination address = unix_server
    Type of service = 00
    Length = 60
    Identification = 47302
    Flags = 4000 (Don't fragment, Last fragment)
    Time to live = 126
    Protocol = 6 TCP
    Transmission Control Protocol (TCP)
    Source Port = 8072
    Destination Port = 2175
    Sequence = 60776554
    Acknowledgement = 2690569245
    Flags = 12 (ACK, SYN)
    Window size = 17520
    ============================= Frame Number 8 =============================
    Frame source = (Network)
    Length = 58
    Time received = 09/24/2002 21:19:42.607
    Frame Relay
    Header = 1041
    0001 00.. 0100 .... = DLCI 68
    .... ..0. .... 000. = (Command)
    EtherType = 0800 IP
    Internet Protocol (IP)
    Source address = unix_server
    Destination address = SQL_server
    Type of service = 00
    Length = 52
    Identification = 58025
    Flags = 0000 (May fragment, Last fragment)
    Time to live = 28
    Protocol = 6 TCP
    Transmission Control Protocol (TCP)
    Source Port = 2175
    Destination Port = 8072
    Sequence = 2690569245
    Acknowledgement = 60776555
    Flags = 10 (ACK)
    Window size = 8192
    ****************************************************8
    ============================= Frame Number 9 =============================
    Frame source = (User)
    Length = 52
    Time received = 09/24/2002 21:21:35.137
    Frame Relay
    Header = 1041
    0001 00.. 0100 .... = DLCI 68
    .... ..0. .... 000. = (Command)
    EtherType = 0800 IP
    Internet Protocol (IP)
    Source address = SQL_server
    Destination address = unix_server
    Type of service = 00
    Length = 40
    Identification = 47451
    Flags = 4000 (Don't fragment, Last fragment)
    Time to live = 126
    Protocol = 6 TCP
    Transmission Control Protocol (TCP)
    Source Port = 8072
    Destination Port = 2175
    Sequence = 60776555
    Acknowledgement = 623322721
    Flags = 04 (RST)
    Window size = 0
    Data (ASCII)
    0000 = 00 00 00 00 00 00 ......
    any help is welcome
    Regards,
    Sunil

    Well then, it beats me. I don't see what the problem could be in this case. :o(
    Get another driver and see what happens. I would recommend jTDS, because I'm one of the developers and I can help you debug it. It only supports basic things (such as forward-only result sets, prepared statements and callable statements) but it should be enough to see if you can connect to SQL Server. The address is http://jtds.sourceforge.net
    Alin.

  • JDBC connection pool failures when used by JMS stores

              We are using WebLogic 6.1 sp2. We defined a separate connection pool for use by
              a JMS Store.
              <JDBCConnectionPool Name="sybaseJMSPool"
              Targets="cluster00"
              InitialCapacity="2"
              MaxCapacity="10"
              DriverName="com.sybase.jdbc2.jdbc.SybDriver"
              Properties="[email protected]@;[email protected]@;charset=utf8"
              URL="jdbc:sybase:Tds:@jms.db.host@/@jms.db.name@"/>
              (note that the @xxx@ string are replaced by actual values).
              We are using Sybase Jconnect 5.5 to a Sybase ASE 12.5 database.
              We deployed this configuration on a number of environments (testing, staging,
              ..). The actual hardware and network configuration is different for the different
              system, but the WebLogic domain stays the same regarding this issue.
              On the test system we frequently get the following exceptions:
              <Aug 13, 2002 1:56:04 PM CEST> <Alert> <JMS> <www00-test> <node00>
              <ExecuteThread: '6' for queue: 'JMS.TimerClientPool'> <> <> <040048>
              <JMSServer "JMSServer00", store failure while writing message for topic
              OrderChangeTopic, java.io.IOException: JMS JDBC store, connection pool =
              <sybaseJMSPool>, prefix = <JMS00>: write failed
              java.sql.SQLException: JZ006: Caught IOException:
              com.sybase.jdbc2.jdbc.SybConnectionDeadException: JZ0C0: Connection is already
              closed.
              at com.sybase.jdbc2.jdbc.ErrorMessage.raiseErrorCheckDead
              (ErrorMessage.java:715)
              at com.sybase.jdbc2.tds.Tds.handleIOE(Tds.java:3124)
              at com.sybase.jdbc2.tds.Tds.cancel(Tds.java:1412)
              at com.sybase.jdbc2.tds.Tds.cancel(Tds.java:1341)
              at com.sybase.jdbc2.jdbc.SybStatement.doCancel(SybStatement.java:564)
              at com.sybase.jdbc2.jdbc.SybStatement.updateLoop(SybStatement.java:1672)
              at com.sybase.jdbc2.jdbc.SybStatement.executeUpdate
              (SybStatement.java:1625)
              at com.sybase.jdbc2.jdbc.SybPreparedStatement.executeUpdate
              (SybPreparedStatement.java:91)
              at com.p6spy.engine.logging.P6LogPreparedStatement.executeUpdate
              (P6LogPreparedStatement.java:179)
              at weblogic.jdbc.pool.Statement.executeUpdate(Statement.java:293)
              at weblogic.jms.store.JDBCIOStream.write(JDBCIOStream.java:1246)
              at weblogic.jms.store.StoreRequest.doTheIO(StoreRequest.java:250)
              at weblogic.jms.store.JMSStore.execute(JMSStore.java:182)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              .>
              java.io.IOException: JMS JDBC store, connection pool = <sybaseJMSPool>, prefix
              = <JMS00>: write failed
              java.sql.SQLException: JZ006: Caught IOException:
              com.sybase.jdbc2.jdbc.SybConnectionDeadException: JZ0C0: Connection is already
              closed.
              at com.sybase.jdbc2.jdbc.ErrorMessage.raiseErrorCheckDead
              (ErrorMessage.java:715)
              at com.sybase.jdbc2.tds.Tds.handleIOE(Tds.java:3124)
              at com.sybase.jdbc2.tds.Tds.cancel(Tds.java:1412)
              at com.sybase.jdbc2.tds.Tds.cancel(Tds.java:1341)
              at com.sybase.jdbc2.jdbc.SybStatement.doCancel(SybStatement.java:564)
              at com.sybase.jdbc2.jdbc.SybStatement.updateLoop(SybStatement.java:1672)
              at com.sybase.jdbc2.jdbc.SybStatement.executeUpdate
              (SybStatement.java:1625)
              at com.sybase.jdbc2.jdbc.SybPreparedStatement.executeUpdate
              (SybPreparedStatement.java:91)
              at com.p6spy.engine.logging.P6LogPreparedStatement.executeUpdate
              (P6LogPreparedStatement.java:179)
              at weblogic.jdbc.pool.Statement.executeUpdate(Statement.java:293)
              at weblogic.jms.store.JDBCIOStream.write(JDBCIOStream.java:1246)
              at weblogic.jms.store.StoreRequest.doTheIO(StoreRequest.java:250)
              at weblogic.jms.store.JMSStore.execute(JMSStore.java:182)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              at weblogic.jms.store.JDBCIOStream.throwIOException
              (JDBCIOStream.java:1213)
              at weblogic.jms.store.JDBCIOStream.write(JDBCIOStream.java:1256)
              at weblogic.jms.store.StoreRequest.doTheIO(StoreRequest.java:250)
              at weblogic.jms.store.JMSStore.execute(JMSStore.java:182)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              Before that this message appeared:
              <Aug 13, 2002 11:31:16 AM CEST> <Error> <ConnectionManager> <www00-test>
              <node00> <ExecuteThread: '26' for queue: 'default'> <> <> <000000>
              <Closing: 'weblogic.rjvm.t3.T3JVMConnection@795af6' because of: 'Server
              received a message over an uninitialized connection: 'JVMMessage from: 'null'
              to: '-4555218188801970213S:192.168.13.1:[7001,7001,7002,7002,7001,7002,-
              1]:ADIS:node00' cmd: 'CMD_REQUEST', QOS: '101', responseId: '1',
              invokableId: '287', flags: 'JVMIDs Not Sent, TX Context Not Sent', abbrev
              offset: '34'''>
              This problem did not occur on another system which was used during a 2 day stress
              testing session.
              It seems that the problem occurs after a period in which no user request where
              made. The user requests trigger EJB's that start sending JMS messages.
              When the problem occurs, the JMS messaging systems seems to lock up as no messages
              are received anymore by the different listeners (MDBs).
              Undeploying and redeploying the JBDC connection pool solves the problem. This
              solution is unacceptable in case of a production system.
              A similarly defined connection pool, which is used by the EJBs to make database
              connection, does not manifest this problem.
              <JDBCConnectionPool Name="sybasePool"
              Targets="cluster00"
              InitialCapacity="10"
              CapacityIncrement="5"
              MaxCapacity="50"
              PreparedStatementCacheSize="150"
              DriverName="com.sybase.jdbc2.jdbc.SybDriver"
              Properties="[email protected]@;[email protected]@;JCONNECT_VERSION=6;charset=utf8"
              URL="jdbc:sybase:Tds:@db.host@/@db.name@"/>
              The JDBC connection pool is used as follows by the JDBC store
              <JMSJDBCStore ConnectionPool="sybaseJMSPool" Name="JDBCStore00" PrefixName="JMS00"/>
              <JMSServer Name="JMSServer00" Store="JDBCStore00" Targets="node00">
              <JMSTopic JNDIName="ADIS.JMSError" JNDINameReplicated="false" Name="ErrorTopic"/>
              <JMSTopic JNDIName="ADIS.Status"
              Name="StatusTopic" RedeliveryDelayOverride="300000"/>
              <JMSTopic JNDIName="ADIS.OrderChange" JNDINameReplicated="false"
              Name="OrderChangeTopic" RedeliveryLimit="3"/>
              </JMSServer>
              Turning on the "Test Reserved Connection" with a appropriate test table does not
              help.
              Some sources on the internet tell us that JZ0C0 errors in the Jconnect driver
              can be related to network problems. Nevertheless the connection pool should be
              able to cope with this.
              Can you provide any solution for this ? Or give us hints what can cause the problem
              

    Zhenhao Qi wrote:
    thanks! Joe.
    The SQL statement itself can no longer be simplified, the long excuation time is due to the database size and complicated Select criteria. I can easily reproduce the problem by using this SQL. I tried "BEA's Oracle driver (Type 4): Version 8.1.7,9.0.1,9.2.0". the question can be dissect into 2 pieces:
    1) why the jdbc connection (using oracle.jdbc.OracleDriver) won't return anything if the SQL execution time > 5min, that is probably the Oracle's problem
    2) why the occupied connection pool won't release even I set "Statementtimeout=600", this is Weblogic's problem.
    ZhenhaoHi. Yes, (1) is oracle's problem. (2) may also be. The JDBC spec has very few
    allowances for one thread to interrupt a second thread's JDBC call. If we
    transmit your timeout request by calling setQueryTimeout() on the oracle
    statement, and if you have a weblogic-controlled transaction we call
    Statement.cancel() on any ongoing statement, we end up relying on whether
    the Oracle driver implements and responds to those calls.
    Are you doing weblogic-controlled transactions? Are you/can you
    call Statement.setQueryTimeout() on your statements, or are these
    generated JDBC queries?
    If you can duplicate the problem using the weblogic.jdbc.oracle.OracleDriver
    we have some other debug avenues. This would be good even if you really
    want to use the thin driver, because we will do the same JDBC calls to
    either driver, and the debug would prove (if) we set up a query timeout
    and if we call cancel(). If we do, then we can know that it is the Oracle
    driver failing in these regards.
    Joe

Maybe you are looking for