-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Ejb3Configuration.setDataSource(dataSource) is ignored
PostPosted: Wed Oct 26, 2005 11:41 am 
Regular
Regular

Joined: Thu Feb 19, 2004 4:48 am
Posts: 62
I'm trying to set an existing datasource into an EntityManager using:

Code:
      Ejb3Configuration cfg = new Ejb3Configuration();
      cfg.addProperties(hibernateProperties);
      cfg.setDataSource(dataSource);
      return cfg.createEntityManagerFactory().createEntityManager();



The DataSource is configured via Spring to use a org.springframework.jdbc.datasource.DataSourceTransactionManager and a Transaction is properly started on the DataSource before I call entityManager.persist(cust).

But I always get a
Code:
        javax.persistence.TransactionRequiredException: no transaction is in progress
, even if I start the transactions manually before the call.

How exactly does
org.hibernate.ejb.AbstractEntityManagerImpl.checkTransactionActive(AbstractEntityManagerImpl.java:123) perform the check, that it is inside a running Transaction?! Do I need a special TransactionManager for this to work?

Thx for any help
stf


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.