HI All,
I got this exception when I will try to add the record in the database. the project work fine on my machine and insert the record , but on production server it has generated exception "org.hibernate.exception.GenericJDBCException: could not insert:" and on digging i found the exception "Incorrect arguments to mysql_stmt_execute" . I can not understand what is the problem ..
Basically I have a table name room which have database script:
room CREATE TABLE `room` (
`Room_Id` mediumint(15) NOT NULL auto_increment,
`Room_Name` varchar(50) default NULL,
`Room_Avitor` varchar(100) default NULL,
`Room_Theme_Id` mediumint(15) default NULL,
`Owner_id` bigint(30) default NULL,
`Compaign_Code` varchar(50) default NULL,
`activation_Code` varchar(50) default NULL,
`Room_Password` varchar(10) default NULL,
`Owner_password` varchar(10) default NULL,
PRIMARY KEY (`Room_Id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8
and I am using struts with hibernate (Java Persistance API). my persistance class is
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" 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/ ... ce_1_0.xsd">
<persistence-unit name="fixafesten" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>com.fixafesten.container.Activationcodes</class>
<class>com.fixafesten.container.Room</class>
<class>com.fixafesten.container.Party</class>
<class>com.fixafesten.container.Forum</class>
<class>com.fixafesten.container.RoomTheme</class>
<class>com.fixafesten.container.RoomUser</class>
<class>com.fixafesten.container.RoomUserPK</class>
<class>com.fixafesten.container.User</class>
<class>com.fixafesten.container.ThreadMessage</class>
<class>com.fixafesten.container.Threads</class>
<class>com.fixafesten.container.PictureGallery</class>
<properties>
<!--this is the comment-->
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<!-- Production settings
<property name="hibernate.connection.datasource" value="jdbc/fixafesten"/>
-->
<!-- Development settings-->
<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/fixafesten"/>
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
<property name="hibernate.connection.password" value="admin"/>
<property name="hibernate.connection.username" value="root"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.c3p0.max_size" value="1"/>
<property name="hibernate.c3p0.min_size" value="0"/>
<property name="hibernate.c3p0.timeout" value="5000"/>
<property name="hibernate.c3p0.max_statements" value="100"/>
<property name="hibernate.c3p0.idle_test_period" value="300"/>
<property name="hibernate.c3p0.acquire_increment" value="2"/>
</properties>
</persistence-unit>
</persistence>
in my struts action class I have a method buildNewRoom in which I create the user and also create room for that user. I take
entityManager = entityManagerFactory.createEntityManager();
userTransaction = entityManager.getTransaction();
userTransaction.begin();
then I create the user and room. both are created successfully on my machine and on testing machine. but on production machine, user is created but on creating room it will generate error Incorrect arguments to mysql_stmt_execute and then "org.hibernate.exception.GenericJDBCException: could not insert:"
Please help......