在 eclipse 运行 jdbc 调用 Oracle 存储过程,存储过程执行完,程序阻塞在等待返回结果 - V2EX
payboy
V2EX    Java

在 eclipse 运行 jdbc 调用 Oracle 存储过程,存储过程执行完,程序阻塞在等待返回结果

  •  
  •   payboy Dec 17, 2018 2797 views
    This topic created in 2704 days ago, the information mentioned may be changed or developed.

    公司一个老项目的业务逻辑写在 Oracle 存储过程里面。现在有一个 jar 程序调用这个存储过程,如果存储过程执行耗时只是 3、4 个小时左右的话,能得到返回结果。但当耗时十几个小时情况下,程序一直阻塞在等待返回结果。 程序用的是 jdbc+c3p0。

    c3p0 配置如下:

    <property name="initialPoolSize">3</property> <property name="maxIdleTime">360</property> <property name="maxPoolSize">10</property> <property name="minPoolSize">3</property> <property name="maxStatements">0</property> <property name="maxStatementsPerConnection">100</property> <property name="acquireRetryAttempts">10</property> <property name="checkoutTimeout">1000</property> <property name="breakAfterAcquireFailure">false</property> <property name="acquireRetryDelay">1000</property> <property name="idleConnectionTestPeriod">60</property> 

    请教一下,执行存储过程的过程中,与 Oracle 的链接会被当作空闲链接吗?有没有可能是 Oracle 数据库的连接过长自动断开了.

    2 replies    2018-12-18 08:28:09 +08:00
    heraldic
        1
    heraldic  
       Dec 18, 2018
    应该是 jdbc 的链接自动断开了,这样的程序运行,直接在 oracle 里面运行过程不好吗?为啥要在外面搞个 jar 调用?
    payboy
        2
    payboy  
    OP
       Dec 18, 2018
    @heraldic 因为是以前的项目,它就这么设计的-_-|| 。现在不论设计如何,我想明白阻塞的原因。没有抛出异常,有什么方法确定是 [jdbc 的链接自动断开了] ?
    About     Help     Advertise     Blog     API     FAQ     Solana     2550 Online   Highest 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 50ms UTC 00:02 PVG 08:02 LAX 17:02 JFK 20:02
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86