Hibernate Books

All times are UTC - 5 hours [ DST ]

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Spring/Hibernate app doesn't write when deployed to Tomcat
PostPosted: Wed Jul 25, 2012 11:38 am 

Joined: Wed Jul 25, 2012 11:17 am
Posts: 1
I have an app created using Hibernate 4.1.4.Final and Spring 3.1.2.RELEASE. I created it using SpringSource Tool Suite 2.9.2.RELEASE.

The issue is that the app works fine when deployed to the vFabric tc Server v2.7 included in STS, but when I deploy it to a standalone Tomcat server (v7.0.29) the app runs fine, but writes to the database (MySQL) don't happen. Reads from the database work fine. The odd bit is that none of the logs show any exceptions or any issues creating the datasource, entity manager, etc.. I am not using a JNDI datasource. This is my spring datasource definition:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<beans xmlns="http://www.springframework.org/schema/beans"

   <bean id="dataSource"
   <bean id="entityManagerFactory"
   <context:component-scan base-package="com.bryant.weather.dao" />
   <bean id="transactionManager"
   <tx:annotation-driven mode="aspectj" transaction-manager="transactionManager" />                  


The entity manager is injected into my code by Spring:
   public void setEntityManager(EntityManager entityManager)
      this.entityManager = entityManager;

I suspect that it has something to do with the MySQL setup and the granting of privileges to a user based on the host, but I have tried every combination of "grant all on dbname.*..." that I can think of.

Generally, if there are exceptions thrown somewhere I can puzzle through these kind of issues, but in this case I am stumped. I don't see any exceptions, but writes to the DB just don't work.

The thought just occurred to me that maybe it is a transaction problem somehow? Do I need to change the Tomcat config somehow to support transactions?

Any thoughts would be appreciated. I can post any additional info that is needed to help debug the issue.


Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 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.