Transaction after closed connection behavior?

Hello

Using JDBC, while doing multiple inserts in a transaction, this Exception was thrown:

java.sql.SQLException: closed connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:873)
at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:792)

Accordingly, the commit() statement would have been forgotten, and the control went to a catch block where restoration has been attempted. With the connection being closed, this resulted in another Exception:

java.sql.SQLException: closed connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
at oracle.jdbc.driver.PhysicalConnection.rollback(PhysicalConnection.java:1170)

If the transaction doesn't has been neither explicitly committed or rolledback by client code.

The connection has been returned to the pool (which I suppose it thrown).

The program then continues by obtaining a new connection from the pool. He began a new transaction with setAutoCommit (false) and started reading the data.

Surprisingly he read the data written in the previous operation (I thought failed with clamp is closed by an external factor).

The program has not changed isolation level transactions, so if I understand correctly, that is still the default value of READ_COMMITTED.

I'm trying to understand what happened here. My understanding is that a local transaction occurs in a session and according to the JDBC docs, a connection is equivalent to a session. Yet, by the only explanation I can offer for the effects that I've seen, it's that here an be persisted between the two separate connections and the beginning of a transaction in the second connection resulted in the validation of the previous transaction half finished in the previously used connection.

Is this possible? This kind of thing is documented anywhere?

See you soon,.
Derek

Hello
documentation (Oracle® Database JDBC Developer's Guide and reference chapter 3, Oracle version 10.2) stipulates that:

If the autocommit mode is disabled and you close the connection without explicitly validate or restore your latest changes, then an implicit VALIDATION operation is performed.

This corresponds to what you have observed.

If you describe the libraries you use (es Spring AOP, plain JDBC, Hibernate, etc) I think that the forum users can proviode of the other suggestions/workarounds.

Ciao,.
Giovanni

Tags: Java

Similar Questions

  • Loading the Google's HTTPS version causes Firefox to do 3 background request every 45 seconds even after closing the page.

    Loading the Google's HTTPS version causes Firefox to do 3 background request every 45 seconds even after closing the page.
    With any other HTTPS sites that support HTTP Strict Transport Security (HST), I noticed connection only 1 history.
    How can I disable these background connections?

    Hello, I'm no expert on the matter, but it is quite possible that the spdy Protocol, which is used by google on its secure sites (twitter atm) and is causing the behavior that you have seen.

    "SPDY connections are persistent connections. For optimal performance, it is expected that clients will not close the open connections until the user navigates away from all web pages referring to a connection, or until the server closes the connection. Servers are encouraged from the connections open as long as possible, but can stop idle connections if necessary. »
    http://mbelshe.github.com/SPDY-specification/draft-mbelshe-SPDY-00.XML#RFC.section.2.1

    You can try to disable support for the spdy Protocol in firefox (in all: config) and see if that changes the number and length of connections to the server.

  • Pavilion g6t-2300 CTO select: seeing power HP Pavilion is still on even after closing down and the battery won't charge no - 10 Windows

    My HP Pavilion power LED is still even after closing. I disabled option quick start, but the problem was not fixed. Another problem is the battery will not charge if it is showing connected. My OS is wondows 10. Please help me. Thank you.

    Hello

    Please try the following fix:

    https://www.CNET.com/forums/discussions/help-my-PC-with-Windows-10-wont-shut-down-properly/

    Kind regards.

  • Cannot Ping hosts after you connect to ASA5500 using a client connection

    I can ping hosts and gateways of the ASA5500, but after I connect I can't ping anything. The ASA5500 is connected to a layer 2 switch, this switch is shared resources for a layer 3. This 3 level switch is connected to another switch to level 3 where the gateways and hosts live. Again, I can ping hosts and gateways of the ASA5500 itself.

    ASA Version 8.2 (5)
    !
    activate 8Ry2YjIyt7RRXU24 encrypted password
    2KFQnbNIdI.2KYOU encrypted passwd
    names of
    !
    interface GigabitEthernet0/0
    nameif outside
    security-level 0
    IP address 208.19.xxx.xx 255.255.255.240
    !
    interface GigabitEthernet0/1
    nameif inside
    security-level 100
    IP 10.47.146.199 255.255.255.0
    !
    interface GigabitEthernet0/2
    Shutdown
    No nameif
    no level of security
    no ip address
    <--- more="" ---="">
    !
    interface GigabitEthernet0/3
    Shutdown
    No nameif
    no level of security
    no ip address
    !
    interface Management0/0
    Shutdown
    No nameif
    no level of security
    no ip address
    !
    passive FTP mode
    DNS server-group DefaultDNS
    permit same-security-traffic inter-interface
    IP 10.47.138.0 allow Access - list extended SHEEP 255.255.255.0 172.16.1.0 255.255.255.0
    IP 10.47.140.0 allow Access - list extended SHEEP 255.255.255.0 172.16.1.0 255.255.255.0
    IP 10.47.141.0 allow Access - list extended SHEEP 255.255.255.0 172.16.1.0 255.255.255.0
    IP 10.47.148.0 allow Access - list extended SHEEP 255.255.255.0 172.16.1.0 255.255.255.0
    IP 10.47.149.0 allow Access - list extended SHEEP 255.255.255.0 172.16.1.0 255.255.255.0
    IP 10.47.150.0 allow Access - list extended SHEEP 255.255.255.0 172.16.1.0 255.255.255.0
    IP 10.47.151.0 allow Access - list extended SHEEP 255.255.255.0 172.16.1.0 255.255.255.0
    IP 10.47.133.0 allow Access - list extended SHEEP 255.255.255.0 172.16.1.0 255.255.255.0
    IP 10.47.212.0 allow Access - list extended SHEEP 255.255.255.0 172.16.1.0 255.255.255.0
    IP 10.47.153.0 allow Access - list extended SHEEP 255.255.255.0 172.16.1.0 255.255.255.0
    IP 10.47.157.0 allow Access - list extended SHEEP 255.255.255.0 172.16.1.0 255.255.255.0
    IP 10.47.154.0 allow Access - list extended SHEEP 255.255.255.0 172.16.1.0 255.255.255.0
    IP 10.47.146.0 allow Access - list extended SHEEP 255.255.255.0 172.16.1.0 255.255.255.0
    pager lines 24
    Within 1500 MTU
    Outside 1500 MTU
    mask 172.16.1.10 - 172.16.1.200 255.255.255.0 IP local pool VPNpool
    no failover
    ICMP unreachable rate-limit 1 burst-size 1
    don't allow no asdm history
    ARP timeout 14400
    Global 1 interface (outside)
    NAT (inside) 1 0.0.0.0 0.0.0.0
    Route outside 0.0.0.0 0.0.0.0 208.19.xxx.xx 1
    Route inside 10.47.133.0 255.255.255.0 10.47.146.1 1
    Route inside 10.47.138.0 255.255.255.0 10.47.146.1 1
    Route inside 10.47.140.0 255.255.255.0 10.47.146.1 1
    Route inside 10.47.141.0 255.255.255.0 10.47.146.1 1
    Route inside 10.47.148.0 255.255.255.0 10.47.146.1 1
    Route inside 10.47.149.0 255.255.255.0 10.47.146.1 1
    Route inside 10.47.150.0 255.255.255.0 10.47.146.1 1
    Route inside 10.47.151.0 255.255.255.0 10.47.146.1 1
    Route inside 10.47.153.0 255.255.255.0 10.47.146.1 1
    Route inside 10.47.154.0 255.255.255.0 10.47.146.1 1
    Route inside 10.47.157.0 255.255.255.0 10.47.146.1 1
    Route inside the 10.47.212.0 255.255.254.0 10.47.146.1 1
    Route inside the 10.47.214.0 255.255.254.0 10.47.146.1 1
    Timeout xlate 03:00
    Timeout conn 01:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
    Sunrpc timeout 0:10:00 h323 0:05:00 h225 mgcp from 01:00 0:05:00 mgcp-pat 0:05:00
    Sip timeout 0:30:00 sip_media 0:02:00 prompt Protocol sip-0: 03:00 sip - disconnect 0:02:00
    Timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute
    timeout tcp-proxy-reassembly 0:01:00
    Floating conn timeout 0:00:00
    dynamic-access-policy-registration DfltAccessPolicy
    No snmp server location
    No snmp Server contact
    life crypto ipsec security association seconds 28800
    Crypto ipsec kilobytes of life - safety 4608000 association
    Telnet timeout 5
    SSH timeout 5
    Console timeout 0
    a basic threat threat detection
    Statistics-list of access threat detection
    no statistical threat detection tcp-interception
    WebVPN
    allow outside
    SVC disk0:/anyconnect-win-3.1.04072-k9.pkg 1 image
    enable SVC
    tunnel-group-list activate
    Anyconnect-policy group policy interns
    Anyconnect-policy-strategy of group attributes
    VPN - 100 simultaneous connections
    VPN-idle-timeout no
    Protocol-tunnel-VPN IPSec l2tp ipsec svc webvpn
    WebVPN
    SVC Dungeon-Installer installed
    SVC request to enable default timeout 20 svc
    username billuser1 password eS3lou7xhp / 8g 705 encrypted
    username billuser1 attributes
    type of remote access service
    tunnel-group bill type remote access
    tunnel-group invoice General attributes
    address pool VPNpool
    strategy-group-by default Anyconnect-policy
    tunnel-group bill webvpn-attributes
    activation of the Group billgroup_users alias
    !
    class-map inspection_default
    match default-inspection-traffic
    !
    !
    type of policy-card inspect dns preset_dns_map
    parameters
    maximum message length automatic of customer
    message-length maximum 512
    Policy-map global_policy
    class inspection_default
    inspect the preset_dns_map dns
    inspect the ftp
    inspect h323 h225
    inspect the h323 ras
    Review the ip options
    inspect the netbios
    inspect the rsh
    inspect the rtsp
    inspect the skinny
    inspect esmtp
    inspect sqlnet
    inspect sunrpc
    inspect the tftp
    inspect the sip
    inspect xdmcp
    !
    global service-policy global_policy
    context of prompt hostname
    no remote anonymous reporting call
    call-home
    Profile of CiscoTAC-1
    no active account
    http https://tools.cisco.com/its/service/oddce/services/De destination address
    email address of destination [email protected] / * /
    destination-mode http transport
    Subscribe to alert-group diagnosis
    Subscribe to alert-group environment
    Subscribe to alert-group monthly periodic inventory
    monthly periodicals to subscribe to alert-group configuration
    daily periodic subscribe to alert-group telemetry
    Cryptochecksum:80003da27b3641b2123e30df5ef6b320
    : end
    cvpn #.

    Hello

    You must ensure that networks l3 behind firewalls have itinerary for your "VPNpool" subnet and you need create the rule of no - NAT as shown below

    NAT (inside) 0 access-list SHEEP

    HTH

    Averroès.

  • region of refresh on the page parent after closing popup inframe

    Hello

    I have parent page with several regions, and one of the reports is related popup to another page using inframe. All these are works fine but now iam trying to a parent region partially regenerate after closing the window contextual inframe, I tried apex.submit (region1) but it does not work? no idea how can I update this after the closure of the window popup?

    Best regards and thank you

    Hi Gor_Mahia,

    Gor_Mahia wrote:

    Here are the details,

    application ID = 46268

    page ID = 13

    demo123/demo123

    proj2010 = workspace

    Use the links in the second column IR

    Once again thanks for your time.

    Check your application now. The interactive report is refreshing on the closure of the modal dialog box using the method of dynamic, such action described in the blog post:

    Monkey on Oracle: Modal popup with dynamic Actions

    Here are the changes:

    • Edited your action dynamic and value:

    In the section "Advanced":

    Scope of the event: Dynamics

    In 'true Actions:

    Action edited your "run the Javascript Code" and "Code" to modified:

    From:

    /* prevent default behavior on click */
    var e = this.browserEvent;
    e.preventDefault();
    /* Trigger JQuery UI dialog */
    var horizontalPadding = 30;
    var verticalPadding = 30;
    $('