Hi Robert,

    I have experience the similar issue with MySQL, MM.MySQL and JBOSS.

    I was using CMP-EJBs with INNODB table from MySQL-Max and data did not
persist in the table as I called EJB create().  The issue resolved as I
'alt' the table back to MyISAM tables.

    I have posted the issue in couple of newsgroups but didn't get a reply
on resolving it nor pin-pointing the cause of it.

Regards,
Michael

----- Original Message -----
From: "Robert Grey" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 24, 2001 11:35 AM
Subject: INSERT Problem with mm.mysql, JBoss and an EJB


> I am currently working on a project employing EJBS contained by JBoss with
a
> MySQL-Max database. Any attempt to insert a record into a "project" table
> yields no entries ("project" is of type BDB) but when project is changed
to
> type MyISAM the entries work. In this particular project, we call multiple
> EJB creates at the same time which is the only difference we can see
between
> the other working EJBs. Here is the schema for table "project":
>
> CREATE TABLE project (
>   PROJECT_ID int(10) unsigned zerofill NOT NULL auto_increment,
>   PROJECT_NAME varchar(25) NOT NULL default '',
>   START_DATE timestamp(14) NOT NULL,
>   PROJECT_STATUS enum('OPEN','CLOSED') NOT NULL default 'OPEN',
>   LOCK_STATUS enum('Y','N') NOT NULL default 'Y',
>   GC_APPROVER enum('OWNER','ARCHITECT') NOT NULL default 'OWNER',
>   END_DATE timestamp(14) NOT NULL,
>   PRIMARY KEY  (PROJECT_ID)
> ) TYPE=BerkeleyDB;
>
> and here is the EJB code that inserts the record:
>
> String qry = "INSERT INTO PROJECT VALUES (NULL, ?, ?, ?, ?, ?, ?)";
>
> PreparedStatement prepStmt = null;
> Statement stmt = null;
> ResultSet rs = null;
> try {
>
> prepStmt = getDBConnection().prepareStatement (qry);
> int i = 1;
> prepStmt.setString(i++, projectDetail.getProjectName());
> prepStmt.setDate(i++, projectDetail.getStartDate());
> prepStmt.setString(i++, projectDetail.getStatus());
> prepStmt.setString(i++, projectDetail.isLocked() ? "Y" : "N");
> prepStmt.setString(i++, projectDetail.getGC_Approver());
> prepStmt.setDate(i++, new java.sql.Date(0));
> prepStmt.executeUpdate();
> prepStmt.close();
> closeConnection();
>
> stmt = getDBConnection().createStatement();
> stmt.executeQuery ("SELECT LAST_INSERT_ID() AS ID");
> rs = stmt.getResultSet();
> rs.first();
> projectId = rs.getInt ("ID");
>
> }
>
> The process of creating the prepared statement works and we can see the
> correct results before the system attempts an insert. When we change the
> query to a regular statement (instead of a prepared statement) JBoss hangs
> and won't budge. When we change the query to "INSERT INTO PROJECT
> (PROJECT_NAME) VALUES ('TEST')" we get the same results. Any suggestions
> would be appreciated.
>
> -Robert Grey
> [EMAIL PROTECTED]
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>
> ---------------------------------------------------------------------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html"; before
> posting. To request this thread, e-mail [EMAIL PROTECTED]
>
> To unsubscribe, send a message to the address shown in the
> List-Unsubscribe header of this message. If you cannot see it,
> e-mail [EMAIL PROTECTED] instead.
>
>

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to