Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7409575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:06:13+00:00 2026-05-29T06:06:13+00:00

Here is my persistence.xml : <?xml version=1.0 encoding=UTF-8?> <persistence xmlns=http://java.sun.com/xml/ns/persistence xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd version=1.0>

  • 0

Here is my persistence.xml :

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
    <persistence-unit name="miniDS" transaction-type="JTA">
    <jta-data-source>java:/miniDS</jta-data-source>

    <class>com.company.model.Ordre</class>

    <properties>
        <!-- Options Hibernate -->
        <property name="hibernate.show_sql" value="true" />
        <property name="hibernate.format_sql" value="true" />
        <property name="hibernate.connection.driver_class" value="org.postgresql.Driver" />
        <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
        <property name="hibernate.hbm2ddl.auto" value="update" />
        <property name="hibernate.default_schema" value="mini" />
                    <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
    </properties>
</persistence-unit>

My code :

// Create order
Ordre o = new Ordre();
o.setDate(req.getParameter("date"));
o.setMotif(req.getParameter("motif"));

log.info("Ordre: " + o.getDate() + " " + o.getMotif());

OrdreService os = new OrdreService();
os.persist(o);//This method is NOT even called !

// Process application flow here...

OrdreService.java :
public class OrdreService {
private OrdreDAO dao;

public OrdreService() {
    dao = new OrdreDAO();
}

public void persist(Ordre o) {
    System.out.println("Service persist");
    dao.persist(o);
}
     //...
 }

OrdreDAO.java :
public class OrdreDAO {
private EntityManagerFactory emf;
private EntityManager em;

public OrdreDAO() {
    emf = Persistence.createEntityManagerFactory("miniDS");
    em = emf.createEntityManager();
}

public void persist(Ordre o) {
    System.out.println("DAO persist");
    EntityTransaction et = null;

    try {
        et = em.getTransaction();

        et.begin();
        em.persist(o);

        System.out.println("commit ?");

        if (et != null) {
            if (et.isActive()) {
                et.commit();
            }
        }
    } catch (Throwable t) {
        t.printStackTrace();
        if (et != null) {
            if (et.isActive()) {
                et.rollback();
            }
        }
    }
}

 //...
}

OrdreService.persist is never called :\ OrdreDAO.persist too.

What’s going on with JBoss ?

JBoss 5.1.0.GA
Postgresql 8.3
JPA 1

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T06:06:14+00:00Added an answer on May 29, 2026 at 6:06 am

    When you use ‘<jta-data-source>‘ set your transaction type to JTA in persistence.xml file:

    <persistence-unit name="your_pu_name" transaction-type="JTA">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Cutting to the case. Persistence.xml <?xml version=1.0 encoding=UTF-8?> <persistence xmlns=http://java.sun.com/xml/ns/persistence xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd version=2.0>
I followed the instruction here: http://www.grails.org/doc/latest/guide/7.%20Validation.html and added into config.groovy : grails.validateable.classes = [liningtest.Warm']
i am making a sample program in hibernate follow this tutorial: http://www.myeclipseide.com/documentation/quickstarts/hibernateintroduction/ using reverse
Here's what I'm trying to do. I'm using JPA persistence in a web application,
Here is my code, which takes two version identifiers in the form 1, 5,
I have my default schema declared in persistence.xml as: <property name=hibernate.default_schema value=MYSCHEMA /> However,
org.hibernate.hql.ast.QuerySyntaxException: users is not mapped [SELECT email, id FROM users WHERE email='dsdd@dds.com' AND password='asasas']
I'm writing a J2SE app (no enterprise container) that uses JPA for persistence. Here
I have my persistence.xml with the same name using TopLink under the META-INF directory.
I have a hibernate project, which uses JPA. my persistence.xml contents is as follows:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.