Consultation on clob Problems

Source: Internet
Author: User

I am struts2 + hibernate3 + spring2 + Oracle 9. What I want to achieve is to import the clob field type to the database,
However, the following error message is displayed:

Active Spring transaction synchronization or active JTA transaction with specified

My structure is as follows:

 

The first is the HBM file:
<Property name = "content" type = "org. springframework. Orm. hibernate3.support. clobstringtype">
<Column name = "content"/>
</Property>

Pojo:

Private string content;

For convenience, I summarized the basic addition, deletion, modification, and so on into a class;

Public class commonserviceimpl extends hibernatedaosupport implements
Commonservice
{

/**
* Save the object
*
* @ Param temp
* @ Param item
* @ Return
*/
Protected serializable save (hibernatetemplate temp, object item ){
Return temp. Save (item );
}
}

OneArticleThe saved implementation classes are as follows:
Public class articleserviceimpl extends commonserviceimpl implements iarticleservice {

..... Other logic methods
}

Applicationcontext. xml configuration file:

<Bean id = "lobhandler" lazy-init = "true" class = "org. springframework. JDBC. Support. lob. oraclelobhandler">
<Property name = "nativejdbcextractor">
<Ref bean = "nativejdbcextractor"/>
</Property>
</Bean>

<Bean id = "nativejdbcextractor" lazy-init = "true"

Class = "org. springframework. JDBC. Support. nativejdbc. simplenativejdbcextractor"/>

 

<Bean id = "sessionfactory" class = "org. springframework. Orm. hibernate3.localsessionfactorybean">
 
<Property name = "datasource">
<Ref local = "datasource"/>
</Property>
<Property name = "lobhandler" ref = "lobhandler"/>

.....
</Bean>

 

<Bean id = "commonserviceimpl" class = "com. trustel. Service. commonserviceimpl">
<Property name = "sessionfactory">
<Ref local = "sessionfactory"/>
</Property>
 
</Bean>










propagation_required



class = "org. springframework. transaction. interceptor. transactionproxyfactorybean ">

true






propagation_required, isolation_default,-exception


Configure the service layer of the article class as follows:
<Bean id = "articleservice"
Class = "com. DJs. Um. service. Article. impl. articleserviceimpl">
<Property name = "articledao">
<Ref bean = "articledao"/>
</Property>
</Bean>
</Beans>

The Dao layer configuration of the article class is as follows:
<Bean id = "articledao" parent = "txproxytemplate">
<Property name = "target">
<Bean class = "com. DJs. Um. Dao. impl. articledaoimpl">
<Property name = "sessionfactory">
<Ref bean = "sessionfactory"/>
</Property>
</Bean>
</Property>
</Bean>

In struts2 action class, you only needCodeEnter articleservice.
The strange thing is that I only configured clob to have this problem. If not, everything works normally.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.