Java Hibernate会话更新未反映在数据库中
我正在使用WebLogic10.3.6+Hibernate3和EJB3.0 我正在尝试更新实体,但它在数据库中没有得到更新。 没有例外 请按如下所示查找hibernate配置文件Java Hibernate会话更新未反映在数据库中,java,hibernate,ejb-3.0,weblogic11g,Java,Hibernate,Ejb 3.0,Weblogic11g,我正在使用WebLogic10.3.6+Hibernate3和EJB3.0 我正在尝试更新实体,但它在数据库中没有得到更新。 没有例外 请按如下所示查找hibernate配置文件 <property name="hibernate.connection.datasource">jdbc/wfAR_ConnectionDS</property> <property name="hibernate.generate_statistics">true</p
<property name="hibernate.connection.datasource">jdbc/wfAR_ConnectionDS</property>
<property name="hibernate.generate_statistics">true</property>
<property name="hibernate.hibernate.session_factory_name">wfAR_ConnectionDS</property>
<property name="hibernate.current_session_context_class">thread</property>
<property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
<property name="hibernate.connection.driver_class">com.microsoft.jdbc.sqlserver.SQLServerDriver</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WeblogicTransactionManagerLookup</property>
<property name="hibernate.transaction.factory.class">org.hibernate.transaction.CMTTransactionFactory</property>
<property name="hibernate.transaction.auto_close_session">false</property>
<property name="hibernate.transaction.flush_before_completion">true</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.use_sql_comments">true</property>
<property name="hibernate.format_sql">true</property>
我可以在控制台中看到以下内容:
**************Trying to Update***********
Hibernate:
/* update
com.ar.flextronics.model.ArCatCustomer */ update
AR_catCustomer
set
SegmentID=?,
MepID=?,
ParentCustomerID=?,
CustomerNumber=?,
CustomerName=?,
VendorID=?,
LocalVATID=?,
[FlexCustomer-Supplier]=?,
VMI=?,
TypeOfBilling=?,
CreditTerms=?,
CustomerCurrencyID=?,
CreditRate=?,
CreditLimit=?,
ParentBPNumInsideCompany=?,
LegalEntityname=?,
Region=?,
Active=?,
ERPName=?,
ERPServer=?,
ERPFinanceCompanyNumber=?,
ERPLogisticCompanyNumber=?,
LastUpdate=?,
UpdatedBy=?,
CustomerTypeID=?
where
CustomerID=?
***********Update Finished***********
但数据并没有保存在数据库中
请帮我解决。谢谢我在您的hibernate配置属性中没有看到:
<property name="hibernate.connection.autocommit">true</property>
我在hibernate配置属性中看不到:
<property name="hibernate.connection.autocommit">true</property>
谢谢,它开始工作了。我使用了自动提交属性。谢谢,它开始工作了。我使用了自动提交属性。
Transaction tx = session.beginTransaction();
//your code
tx.commit();
session.close();