-->
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.  [ 3 posts ] 
Author Message
 Post subject: Using Ejb3Configuration to create non extended factory
PostPosted: Thu Jun 22, 2006 2:47 am 
Newbie

Joined: Thu Mar 02, 2006 10:02 am
Posts: 6
I'm using the following code in order to create a EntityManagerFactory:

Ejb3Configuration cfg = new Ejb3Configuration();
cfg.addProperties(map);
cfg.addAnnotatedClass(Subnet.class);
cfg.addAnnotatedClass(Device.class);

EntityManagerFactory factory = cfg.createEntityManagerFactory();

//The map includes the following properties:

p.put("hibernate.transaction.manager_lookup_class",
"org.hibernate.transaction.JBossTransactionManagerLookup");

p.put("hibernate.dialect",
"org.hibernate.dialect.MySQLDialect");

p.put("hibernate.show_sql",
"true");

p.put("hibernate.cache.provider_class",
"org.hibernate.cache.HashtableCacheProvider");

p.put("hibernate.jndi.java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");

p.put("hibernate.jndi.java.naming.factory.url.pkgs",
"org.jboss.naming:org.jnp.interfaces");

p.put("hibernate.bytecode.use_reflection_optimizer",
"false");

p.put("hibernate.bytecode.provider",
"javassist");

p.put("hibernate.connection.driver_class",
"com.mysql.jdbc.Driver");

p.put("hibernate.connection.username",
"root");

p.put("hibernate.connection.password",
"root");

p.put("hibernate.connection.url",
"jdbc:mysql://localhost:3306/"+plan);

p.put("hibernate.max_fetch_depth",
"3");

p.put("javax.persistence.transactionType",
"JTA");

My problem is that the created factory is with PersistenceContextType EXTENDED.

What should I do in order to make it of type TRANSACTION?


Thanks,

Eyal Adi


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 02, 2006 3:20 pm 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
I think you can't.
That is only for container managed EMF.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 07, 2006 9:32 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
ales is right, that's the container responsibility to make a entitymanager TRANSACTION rather than EXTENDED.

But I used to support that at the EM level, if there is enough people willing to have that I can work on the code reactivation

_________________
Emmanuel


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

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.