`
kanpiaoxue
  • 浏览: 1782099 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

Configuration can't be altered once the class has been compiled or used

 
阅读更多

使用Spring org.springframework.jdbc.core.simple.SimpleJdbcInsert获得table的元数据的时候,报错:

 

org.springframework.dao.InvalidDataAccessApiUsageException: Configuration can't be altered once the class has been compiled or used

找了资料,是这么说的:

写道
compiled means you have instantiated a simpleJdbcInsert instance and set up data source and table name already. Once an simpleJdbcInsert instance is compiled, you should not re-config it again; for instance, set another table name. Create a new simpleJdbcInsert instace if you need to do so.

 也就意味着,不能再spring里面像使用JdbcTemplate一样在一个spring上下文中使用一个单例。要想多次重复使用SimpleJdbcInsert,就需要每次都创建一个SimpleJdbcInsert的实例。也就是为一个数据源下面的一张表要单独创建一个SimpleJdbcInsert。

我将代码修改了,每次调用方法的时候,如下:

SimpleJdbcInsert simpleJdbcInsert = new SimpleJdbcInsert(jdbcTemplate);

 就可以解决这个问题。

 

参考:http://stackoverflow.com/questions/15606588/org-springframework-dao-invaliddataaccessapiusageexception-configuration-cant

 

 

分享到:
评论

相关推荐

    BURNINTEST--硬件检测工具

    can stop in the operating system - i.e. there is a problem in the operating system/ device driver that prevents control being returned to the BurnInTest for that test. This was added for ...

    a project model for the FreeBSD Project.7z

    Such an output can either be an input to another activity or a part of the process' delivery. 2.2. Process A “process” is a series of activities that lead towards a particular outcome. A process ...

    Recover4all Professional

    Once the Registration Key has first been saved onto such one (1) computer for each one (1) purchased license the Registration Key may not be saved and the Registered Software may not be used on any ...

    LCTF软件备份VariSpec™ Liquid Crystal Tunable Filters

    although they can be called in an asynchronous mode where the function returns as soon as all commands have been sent to the VariSpec, without waiting for them to run to completion. Another option ...

    Sakemail

    seems that some servers can‘t deglut the info too fast, causing problems with sockets buffers and leading to crash the client machine, I don‘t know if is a Borland bug or Microsoft bug. (thanks to ...

    ICS delphixe10源码版

    The latest versions of ICS can be downloaded from the ICS Wiki web site: http://wiki.overbyte.be/wiki/index.php/ICS_Download ICS V5 and V6 are archive releases no longer updated, last supported ...

    USB短信猫驱动

    For most operating environments, the default configuration of FTDIBUS is sufficient for normal operation, and it is very unlikely that any of the parameters described here need to be altered. ...

    最新版GDAL,有关开源遥感处理的

    license, as long as the normal SFX banner has not been removed from the binary or disabled. 3. Altered versions--including, but not limited to, ports to new operating systems, existing ports with...

    Formal Correctness of Security Protocols

    has shown that the Inductive Method can easily be extended to new security environments, which can then be studied formally. Such work enables the development of a new generation of automatic tools, ...

    OCP考试资料-OCP-19c-082.docx

    ROLLBACK语句后,再执行DML语句。(提交或回滚结束事务,接着的DML开启新事务)答案:A、B **知识点详解** 1. **Oracle数据库中的节省空间功能** - A....实际上,UNUSABLE属性只是标记索引为不可用,但其占用的空间...

    Direct Oracle Access 413 Delphi XE6 Version

    These costs will be an amount of US$10 administration fee for every week the invoice has not been paid after 30 days and an interest of 15% -of the amount not paid- per year. In addition to these ...

    The Transport Layer Security (TLS) Protocol V1.1

    - **Integrity**: Ensuring that data has not been altered during transmission. - **Authentication**: Verifying the identities of both parties involved in the communication. - **Non-repudiation**: ...

    BlueToolInstall

    1.3. “Broadcom Product” means any of the proprietary integrated circuit product(s) sold by Broadcom with which the Software was designed to be used, or their successors. 1.4. “Derivative Work” ...

    Refactoring JavaScript: Turning Bad Code Into Good Code [Kindle Edition]

    ” where each developer slowly and carefully takes their best guess at how the out-of-control system can be altered to allow for new features, hoping that this doesn’t bring the whole stack of blocks...

    google-java-format

    The formatter can act on whole files, on limited lines, on specific offsets, passing through to standard-out (default) or altered in-place. There is no configurability as to the formatter's algorithm...

    大学毕业论文-—基于simulink的通信系统仿真.doc

    In PSK, the phase of the carrier is altered according to the input data. Among these, QPSK simultaneously modulates two orthogonal carrier waves, shifting their phases to represent two bits of ...

    CodeProtector

    The add-in offers a transparent view of the protection results, allowing developers to see how the code has been altered and to make any necessary adjustments. Additionally, developers can insert ...

    EN 60601-1:2006+A11

    The start and finish of text introduced or altered by corrigendum is indicated in the text by tags. Text altered by IEC corrigendum December 2006 is indicated in the text by ˆ‰. Text altered by IEC ...

Global site tag (gtag.js) - Google Analytics