का उपयोग कर लेनदेन प्राप्त करने में सफलतापूर्वक अपवाद शुरू नहीं हुआ है मेरे पास एक उपयोगकर्ता प्रोफाइल इकाई है जिसे मुझे सहेजने की आवश्यकता है। इसके अलावा जब मैं तालिका देखें इकाई के बजाय एक रोलबैक करने का एक समान होती हैस्प्रिंग हाइबरनेट
Could not commit Hibernate transaction; nested exception is org.hibernate.TransactionException: Transaction not successfully started
: डेटाबेस में इकाई बचाने के बाद, मैं निम्न अपवाद प्राप्त करें!
@Transactional(isolation=Isolation.REPEATABLE_READ)
public class HibernateUserProfileDAO implements UserProfileDAO {
private org.hibernate.SessionFactory sessionFactory;
public UserProfile getUserProfile(int userId) {
org.hibernate.classic.Session session = sessionFactory.getCurrentSession();
session.beginTransaction();
UserProfile userProfile = new UserProfile();
userProfile.setUserName("sury1");
session.save(userProfile);
session.getTransaction().commit();
session.close();
return userProfile;
}
}
मैं हाइबरनेट लेनदेन प्रबंधक
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
उपयोग कर रहा हूँ और मेरी हाइबरनेट config है:
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="packagesToScan" value="com.springheatmvn.domain"/>
<property name="hibernateProperties">
<props>
<prop key="hibernate.connection.pool_size">10</prop>
<prop key="hibernate.connection.show_sql">true</prop>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
</props>
</property>
</bean>
किसी pl कर सकते हैं। मुझे बताओ कि यहाँ क्या हो रहा है?
'@ user354161' 'बोझो' – Bitmap