ORA-12519

问题:

用hibernate实现批量插入oracle数据库操作的时候,出现ORA-12519: TNS:no appropriate service handler found 异常。实际最终代码未出现该异常,插入成功记录数量为6000多条。

解决方法:

将hibernate属性配置做些修改,最终配置如下:

<property name="hibernateProperties">

   <props>

    <prop key="hibernate.dialect">org.hibernate.dialect.Oracle9iDialect</prop>

    <prop key="hibernate.show_sql">false</prop>

    <prop key="hiberante.format_sql">false</prop>

    <prop key="hibernate.c3p0.max_size">2</prop>

    <prop key="hibernate.c3p0.min_size">0</prop>

    <prop key="hibernate.c3p0.timeout">1000</prop>

    <prop key="hibernate.c3p0.max_statements">10000</prop>

    </props>

  </property>

一开始报异常的配置如下:

<property name="hibernateProperties">

   <props>

    <prop key="hibernate.dialect">org.hibernate.dialect.Oracle9iDialect</prop>

    <prop key="hibernate.show_sql">false</prop>

    <prop key="hiberante.format_sql">false</prop>

    <prop key="hibernate.c3p0.max_size">50</prop>

    <prop key="hibernate.c3p0.min_size">0</prop>

    <prop key="hibernate.c3p0.timeout">1000</prop>

    <prop key="hibernate.c3p0.max_statements">1000</prop>

    </props>

  </property>

期间操作:只是对以下两属性配置进行了修改

<prop key="hibernate.c3p0.max_size">2</prop>
<prop key="hibernate.c3p0.max_statements">10000</prop>

over~

你可能感兴趣的:(ORA-12519)