MySQL Transaction last_insert_id

Can anyone tell me how to get the last inserted id when in transaction ?
I have to do inserts in several tables.
Problem is when inserting into one table my auto_increment id of the table should be used as a foreign key in the next table and so on.
I think when in transaction I cannot query for the last_insert_id with my existing connection, because it is not yet committed.
Is there a (standard) way to solve this problem ?

It depends what you mean by "standard". Standard to MySQL, you could use this:
SELECT LAST_INSERT_ID();
Some vendors provide driver-specific extensions to allow retrieval of such a value.
If you want a more portable solution then you could create a stored procedure to carry out the insert and have it return the ID as an out value.
There are other techniques, but I don't think there's a "standard" way to retrieve this value on insert, because this isn't a "standard" SQL feature in the first place.
Oh, and as far as I know most users couldn't care less about the duke dollars thing - they're not actually useful in any way.
Patience is a virtue.
Dave.

Similar Messages

  • Running MySQL transaction

    Hi you all,
    I have the following sql statement:
    START TRANSACTION;
    INSERT INTO mek_t_entity(name,dateCreated)VALUES('name',CURDATE());
    INSERT INTO mek_t_user(idEntity_PK,favoriteBooks,favoriteFood,...)VALUES(LAST_INSERT_ID(),favoriteBooks,...);
    COMMIT;Which I run using this code:
        public String runStatement(String pStrStmt)
            try
                Statement objStmt = this.objConn.createStatement();
                objStmt.execute(pStrStmt);
                objStmt = null;
            catch(SQLException ex)
                return ex.getMessage();
            return "";
        }I haven't been able to run this transaction and I can't figure out what the problem is. I get a sql error, but the query runs just fine. Is there any problem whilst runnint transactions like this?
    Any help is welcome,
    Many thanks,
    MeTitus

    This is the error:
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';INSERT INTO mek_t_entity(name,dateCreated)VALUES('name',CURDATE());INSERT INTO ' at line 1and this is where I build the sql statement:
            objDatabase.openConn();
            this.sqlStatement.append("START TRANSACTION;");
            this.sqlStatement.append("INSERT INTO mek_t_entity(name,dateCreated)");
            this.sqlStatement.append("VALUES('" + super.name + "',CURDATE());"); 
            this.sqlStatement.append("INSERT INTO mek_t_user(idEntity_PK,favoriteBooks,favoriteFood,favoriteMusic,favoriteMovies,hobbies,idOccupation_FK,isPrivate,dob,username,password,email,mobile,active,gender)");
            this.sqlStatement.append("VALUES(LAST_INSERT_ID()," + this.favoriteBooks + "," + this.favoriteFood + "," + this.favoriteMusic + "," + this.favoriteMovies + ","  + this.hobbies + "," + this.occupation + "," + this.isPrivate +  ",DATE(" + this.dob + ")," + this.username + "," + this.password + "," +  this.email + "," + this.mobile + "," + this.isActive + "," + this.gender + " );");
            this.sqlStatement.append("COMMIT;");
            objDatabase.runStatement(this.sqlStatement.toString());MeTitus

  • Can't get jdbc MySQL transactions to work

    Hi
    I'm trying to get a series of MySQL statements to work as a transaction but I can't get the transaction side to work.
    I have the tables set up as InnoDB to support transactions.
    My current code is written like this (from after the connection is opened). This method throws SQLException.
    Statement statement = connection.createStatement();
    String sql = "BEGIN;";
    int i = statement.executeUpdate(sql);
    // insert row into TABLE persons
    sql = "INSERT INTO persons SET " +
                  "personID='" + p.getPersonID() + "', " +
                  "firstName='" + p.getFirstName() + "', " +
                  "lastName='" + p.getLastName() + "', " +
                  "emailAddress='" + p.getEmailAddress() + "', " +
                  "password='" + p.getPassword() + "', " +
                  "approvalRating='" + p.getApprovalRating() + "';";
    i = statement.executeUpdate(sql);
    // get the address object associated with p
    Address a = p.getAddress();
    // insert row into TABLE addresses
    sql = "INSERT INTO addresses SET " +
                  "personID='" + a.getPersonID() + "', " +
                  "address1='" + a.getAddress1() + "', " +
                  "address2='" + a.getAddress2() + "', " +
                  "town='" + a.getTown() + "', " +
                  "city='" + a.getCity() + "', " +
                  "county='" + a.getCounty() + "', " +
                  "country='" + a.getCountry() + "', " +
                  "postcodeArea='" + a.getPostcodeArea() + "', " +
                  "postcode2='" + a.getPostcode2() + "', " +
                  "phoneHome='" + a.getPhoneHome() + "', " +
                  "phoneWork='" + a.getPhoneWork() + "', " +
                  "phoneMobile='" + a.getPhoneMobile() + "';";
    i = statement.executeUpdate(sql);
    sql = "COMMIT;";
    int i = statement.executeUpdate(sql);When the SQLException is caught, I want to execute a ROLLBACK
    I can't seem to get this to work. What am I doing wrong?

    1.) Which exact exception do you get and at what line?
    2.) You should really use PreparedStatements and set the parameters there instead of building a dynamic SQL string, because that's greatly in danger of beeing attacked with a SQL injection attack. See http://en.wikipedia.org/wiki/SQL_injection for details.
    3.) You don't need to execute "COMMIT;" as a SQL command, there's connection.commit() for this (make sure that auto-commit is off, using connection.setAutoCommit() if necessary).
    Edit: 4.) You don't need to do "BEGIN" as well (what gave you the idea, by the way?)

  • MySQL - Transactions without locks?

    Hi , I am using the native transaction support of mysql innodb ( setautocommit(false) etc etc).
    I also want to have multiple connections to the database which are able to update the same rows etc. - -now the error I'm getting is 'lock wait timeout'.
    Probably this forum is not the exact place for this question, but is there any way of unlocking the rows? ie i start a transaction, insert some row, then want another connection/transaction to be able to update that row - and then commit or rollback either transaction I feel like. Timeout is not a solution as i want overlapping transactions.
    This might sound mad/bad but please don't reply telling me its dangerous etc etc
    Any help much appreciated,
    thanks

    Hi , I am using the native transaction support of
    mysql innodb ( setautocommit(false) etc etc).
    I also want to have multiple connections to the
    database which are able to update the same rows etc.
    - -now the error I'm getting is 'lock wait timeout'.
    Probably this forum is not the exact place for this
    question, but is there any way of unlocking the rows?
    ie i start a transaction, insert some row, then want
    another connection/transaction to be able to update
    that row - and then commit or rollback either
    transaction I feel like. Timeout is not a solution
    n as i want overlapping transactions.
    As far as I know, no database does overlapping transactions. (I suspect that either it is not feasible or it would have a huge performance impact. Or both.)
    So your choice is either to live with the locks or stop using explicit transactions and write one row at a time.

  • MySQL transactions are not enabled

    Hi,
    We cannot connect to a MySQL 4.0 database with dg4odbc, although it previously connected ok when using hsodbc on 10g (we are now on 11g R2). Unfortunately, the MySQL database is part of a commerical software application, so we cannot make any major changes to the MySQL database or upgrade it to a more recent version.
    The error we get when trying to connect to the dblink is [MySQL][ODBC 3.51 Driver]Transactions are not enabled, option value SQL_AUTOCOMMIT_OFF changed to SQL_AUTOCOMMIT_ON {01S02,NativeErr = 502}.
    Is there anyway to get past this error message. We are using the MySQL 3.5.27 ODBC connector. Both Oracle and MySQL are on Windows Server 2008 R2.
    Thanks

    Hi,
    DG4ODBC has different ODBC driver requirements from the earlier HSODBC. These are listed in the documentation -
    Oracle® Database Gateway for ODBC
    User’s Guide
    11g Release 1 (11.1)
    ODBC Connectivity Requirements
    There have been some issues with DG4ODBC and the 3.5 driver accessing MySQL v4 so do you know if the MYSQL v5 drivers can be used with MySQL v4 ? This may be an option if possible.
    Regards,
    Mike

  • Mysql, transactions and connections

    Hi,
    I have two problems:
    1. I am using mysql 3.23 and JBuilder 6 and I would like to use transactions.
    I created a database and a table InnoDb and when I try from my application to setautocommit(false) I get the following error:
    See com.borland.dx.dataset.DataSetException error code: BASE+66
    com.borland.dx.dataset.DataSetException: Cannot disable AUTO_COMMIT
    I tried lots of things in the mysql server and in my application and I don't know wether it's a configuration of the server, something I need to set first in the WinMySqlAdmin or something I have to do in my application.
    I would really use some help.. If anyone could also provide a small example please..
    2. It's also related to Mysql
    I have a server that opens a connection to the database. I want to know what I have to set in the mysql server so that the connection is not lost if the server is not active a long time.. I thought that if I set the interactive_timeout and the wait_timeout at a high level the problems would be solved but when I did some testing by setting the values to 30 seconds the connection persisted. Does anyone know why?
    Please help
    Thanks

    "MySql does not support transactions" is correct.
    Basically there are no commit or rollback statements
    available in MySql. This is I am talking about
    version 3.2.3 I believe. I have used it long back.incorrect.
    if you use the default myISAM tables than there is no transaction support. however, if you use INNODB then there is transaction support available in versions of 3 etc. for sure.
    however, you need a driver that knows this and supports this. i believe the newer versions of the mysql driver support them i know the older org.gjt.mm driver does NOT.
    what driver are you using? some borland one? look at the support there.

  • Once again:  Does MySQL allow multiple querys in one database transaction???

    Hello to ALL!!!
    The problem is:
    I'm trying to make simple query (database: "myDB" (engine:
    myisam/innodb - doesn't mater) with one table: "Info" with two
    columns: "Id" (autoinc), "info_c" (varchar):
    <cfif structkeyexists (form, "name")>
    <cfquery datasource="myDB" name="qDB" >
    INSERT into Info (info_c)
    VALUES ('#form.name#');
    SELECT @@identity AS Id
    </cfquery>
    </cfif>
    <cfform>
    <cfinput type="text" name="name">
    <cfinput type="submit" name="submit">
    </cfform>
    BUT after "Submit" I get:
    Error Executing Database Query.
    You have an error in your SQL syntax; check the manual that
    corresponds to your MySQL server version for the right syntax to
    use near '; select @@identity as Id' at line 2
    Please, tell me WHY???
    I have:
    MySQL
    Server information:
    MySQL version: MySQL 5.1.25-rc-community via TCP/IP
    Clent Information:
    Version: MySQL client version 5.1.11
    Coldfusion Version Information:
    Version 8,0,0,176276
    Great THANKS for your answers!!!

    > SELECT @@identity AS Id
    AFAIK, MySQL uses LAST_INSERT_ID(). @@IDENTITY is MS SQL
    specific. Though SCOPE_IDENITY() is recommended over @@IDENTITY.
    What version of CF are you using? ColdFusion supports the
    "result" attribute, which will return the ID value for simple
    inserts. See the documentation for details
    http://livedocs.adobe.com/coldfusion/8/Tags_p-q_17.html
    > Do JDBC drivers for MySQL prohibit the use of multiple
    queries
    > in a single database transaction???
    For security purposes this is disabled by default. To enable
    it you must modify your datasource url
    http://www.petefreitag.com/item/357.cfm

  • "com.mysql.jdbc.PacketTooBigException": Help needed urgently

    hi,
    I am using mm.mysql j/connector ver 3.0.6 and MYSQL server version 4.0.
    Max_allowed packet= 8MB at the server side
    I am getting PacketTooBigException when i am trying to update a particular column.
    What should i do.
    Any help will be greatly appreciated!!!

    the driver uses a 64 k max packet size by default. it is supposed to change this as neccessary upon connection but perhaps that is failing?
    below is the 3.0.7 connection code that i have slightly modified for you so that it prints out the connection properties after they have been initialized so that you can see what they are.
    try it out and i hope you find this helpful.
       Copyright (C) 2002 MySQL AB
          This program is free software; you can redistribute it and/or modify
          it under the terms of the GNU General Public License as published by
          the Free Software Foundation; either version 2 of the License, or
          (at your option) any later version.
          This program is distributed in the hope that it will be useful,
          but WITHOUT ANY WARRANTY; without even the implied warranty of
          MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
          GNU General Public License for more details.
          You should have received a copy of the GNU General Public License
          along with this program; if not, write to the Free Software
          Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    /*Slight Modification by Max Stocker April 29, 2003 to trace what the connection values get initialized to. */
    package com.mysql.jdbc;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.Reader;
    import java.io.UnsupportedEncodingException;
    import java.math.BigDecimal;
    import java.net.URL;
    import java.sql.Clob;
    import java.sql.Date;
    import java.sql.ParameterMetaData;
    import java.sql.Ref;
    import java.sql.SQLException;
    import java.sql.Savepoint;
    import java.sql.Time;
    import java.sql.Timestamp;
    import java.util.ArrayList;
    import java.util.Calendar;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.List;
    import java.util.Map;
    import java.util.Properties;
    import java.util.StringTokenizer;
    import java.util.TimeZone;
    * A Connection represents a session with a specific database.  Within the
    * context of a Connection, SQL statements are executed and results are
    * returned.
    * <P>A Connection's database is able to provide information describing
    * its tables, its supported SQL grammar, its stored procedures, the
    * capabilities of this connection, etc.  This information is obtained
    * with the getMetaData method.
    * @see java.sql.Connection
    * @author Mark Matthews
    * @version $Id: Connection.java,v 1.31.2.19 2003/03/28 22:42:24 mmatthew Exp $
    public class Connection implements java.sql.Connection {
        // The command used to "ping" the database.
        // Newer versions of MySQL server have a ping() command,
        // but this works for everything
        private static final String PING_COMMAND = "SELECT 1";
         * Map mysql transaction isolation level name to
         * java.sql.Connection.TRANSACTION_XXX
        private static Map mapTransIsolationName2Value = null;
         * The mapping between MySQL charset names
         * and Java charset names.
         * Initialized by loadCharacterSetMapping()
        private static Map charsetMap;
         * Table of multi-byte charsets.
         * Initialized by loadCharacterSetMapping()
        private static Map multibyteCharsetsMap;
         * Default socket factory classname
        private static final String DEFAULT_SOCKET_FACTORY = StandardSocketFactory.class
            .getName();
        static {
            loadCharacterSetMapping();
            mapTransIsolationName2Value = new HashMap(8);
            mapTransIsolationName2Value.put("READ-UNCOMMITED",
                new Integer(TRANSACTION_READ_UNCOMMITTED));
              mapTransIsolationName2Value.put("READ-UNCOMMITTED",
                   new Integer(TRANSACTION_READ_UNCOMMITTED));
            mapTransIsolationName2Value.put("READ-COMMITTED",
                new Integer(TRANSACTION_READ_COMMITTED));
            mapTransIsolationName2Value.put("REPEATABLE-READ",
                new Integer(TRANSACTION_REPEATABLE_READ));
            mapTransIsolationName2Value.put("SERIALIZABLE",
                new Integer(TRANSACTION_SERIALIZABLE));
         * Internal DBMD to use for various database-version
         * specific features
        private DatabaseMetaData dbmd = null;
         * The list of host(s) to try and connect to
        private List hostList = null;
          * A map of statements that have had setMaxRows() called on them
         private Map statementsUsingMaxRows;
         * The I/O abstraction interface (network conn to
         * MySQL server
        private MysqlIO io = null;
         * Mutex
        private final Object mutex = new Object();
         * The driver instance that created us
        private NonRegisteringDriver myDriver;
         * The map of server variables that we retrieve
         * at connection init.
        private Map serverVariables = null;
         * Properties for this connection specified by user
        private Properties props = null;
         * The database we're currently using
         * (called Catalog in JDBC terms).
        private String database = null;
         * If we're doing unicode character conversions,
         * what encoding do we use?
        private String encoding = null;
         * The hostname we're connected to
        private String host = null;
         * The JDBC URL we're using
        private String myURL = null;
         * The password we used
        private String password = null;
         * Classname for socket factory
        private String socketFactoryClassName = null;
         * The user we're connected as
        private String user = null;
         * The timezone of the server
        private TimeZone serverTimezone = null;
         * Allow LOAD LOCAL INFILE (defaults to true)
        private boolean allowLoadLocalInfile = true;
         * Are we in autoCommit mode?
        private boolean autoCommit = true;
         * Should we capitalize mysql types
        private boolean capitalizeDBMDTypes = false;
         * Should we continue processing batch commands if
         * one fails. The JDBC spec allows either way, so
         * we let the user choose
        private boolean continueBatchOnError = true;
         * Should we do unicode character conversions?
        private boolean doUnicode = false;
         * Are we failed-over to a non-master host
        private boolean failedOver = false;
        /** Does the server suuport isolation levels? */
        private boolean hasIsolationLevels = false;
         * Does this version of MySQL support quoted identifiers?
        private boolean hasQuotedIdentifiers = false;
        // This is for the high availability :) routines
        private boolean highAvailability = false;
         * Has this connection been closed?
        private boolean isClosed = true;
         * Should we tell MySQL that we're an interactive client?
        private boolean isInteractiveClient = false;
         * Is the server configured to use lower-case
         * table names only?
        private boolean lowerCaseTableNames = false;
         * Has the max-rows setting been changed from
         * the default?
        private boolean maxRowsChanged = false;
         * Do we expose sensitive information in exception
         * and error messages?
        private boolean paranoid = false;
         * Should we do 'extra' sanity checks?
        private boolean pedantic = false;
         * Are we in read-only mode?
        private boolean readOnly = false;
        /** Do we relax the autoCommit semantics? (For enhydra, for example) */
        private boolean relaxAutoCommit = false;
         * Do we need to correct endpoint rounding errors
        private boolean strictFloatingPoint = false;
         * Do we check all keys for updatable result sets?
        private boolean strictUpdates = true;
        /** Are transactions supported by the MySQL server we are connected to? */
        private boolean transactionsSupported = false;
         * Has ANSI_QUOTES been enabled on the server?
        private boolean useAnsiQuotes = false;
         * Should we use compression?
        private boolean useCompression = false;
         * Can we use the "ping" command rather than a
         * query?
        private boolean useFastPing = false;
         * Should we tack on @hostname in DBMD.getTable/ColumnPrivileges()?
        private boolean useHostsInPrivileges = true;
         * Should we use SSL?
        private boolean useSSL = false;
         * Should we use stream lengths in prepared statements?
         * (true by default == JDBC compliant)
        private boolean useStreamLengthsInPrepStmts = true;
         * Should we use timezone information?
        private boolean useTimezone = false;
        /** Should we return PreparedStatements for UltraDev's stupid bug? */
        private boolean useUltraDevWorkAround = false;
        private double initialTimeout = 2.0D;
         * How many hosts are in the host list?
        private int hostListSize = 0;
         * isolation level
        private int isolationLevel = java.sql.Connection.TRANSACTION_READ_COMMITTED;
         * The largest packet we can send (changed
         * once we know what the server supports, we
         * get this at connection init).
        private int maxAllowedPacket = 65536;
        private int maxReconnects = 3;
         * The max rows that a result set can contain.
         * Defaults to -1, which according to the JDBC
         * spec means "all".
        private int maxRows = -1;
        private int netBufferLength = 16384;
         * The port number we're connected to
         * (defaults to 3306)
        private int port = 3306;
         * How many queries should we wait before we try to re-connect
         * to the master, when we are failing over to replicated hosts
         * Defaults to 50
        private int queriesBeforeRetryMaster = 50;
         * What should we set the socket timeout to?
        private int socketTimeout = 0; // infinite
         * When did the last query finish?
        private long lastQueryFinishedTime = 0;
         * When did the master fail?
        private long masterFailTimeMillis = 0L;
         * Number of queries we've issued since the master
         * failed
        private long queriesIssuedFailedOver = 0;
         * How many seconds should we wait before retrying to connect
         * to the master if failed over? We fall back when either
         * queriesBeforeRetryMaster or secondsBeforeRetryMaster is
         * reached.
        private long secondsBeforeRetryMaster = 30L;
         * The type map for UDTs (not implemented, but used by
         * some third-party vendors, most notably IBM WebSphere)
        private Map typeMap;
         * Ignore non-transactional table warning for rollback?
        private boolean ignoreNonTxTables = false;
         * Creates a connection to a MySQL Server.
         * @param host the hostname of the database server
         * @param port the port number the server is listening on
         * @param info a Properties[] list holding the user and password
         * @param database the database to connect to
         * @param url the URL of the connection
         * @param d the Driver instantation of the connection
         * @exception java.sql.SQLException if a database access error occurs
        Connection(String host, int port, Properties info, String database,
            String url, NonRegisteringDriver d) throws java.sql.SQLException {
            if (Driver.TRACE) {
                Object[] args = { host, new Integer(port), info, database, url, d };
                Debug.methodCall(this, "constructor", args);
            this.serverVariables = new HashMap();
            hostList = new ArrayList();
            if (host == null) {
                this.host = "localhost";
                hostList.add(this.host);
            } else if (host.indexOf(",") != -1) {
                // multiple hosts separated by commas (failover)
                StringTokenizer hostTokenizer = new StringTokenizer(host, ",", false);
                while (hostTokenizer.hasMoreTokens()) {
                    hostList.add(hostTokenizer.nextToken().trim());
            } else {
                this.host = host;
                hostList.add(this.host);
            hostListSize = hostList.size();
            this.port = port;
            if (database == null) {
                throw new SQLException("Malformed URL '" + url + "'.", "S1000");
            this.database = database;
            this.myURL = url;
            this.myDriver = d;
            this.user = info.getProperty("user");
            this.password = info.getProperty("password");
            if ((this.user == null) || this.user.equals("")) {
                this.user = "nobody";
            if (this.password == null) {
                this.password = "";
            this.props = info;
            initializeDriverProperties(info);
            if (Driver.DEBUG) {
                System.out.println("Connect: " + this.user + " to " + this.database);
            try {
                createNewIO(false);
                this.dbmd = new DatabaseMetaData(this, this.database);
            } catch (java.sql.SQLException ex) {
                cleanup();
                // don't clobber SQL exceptions
                throw ex;
            } catch (Exception ex) {
                cleanup();
                StringBuffer mesg = new StringBuffer();
                if (!useParanoidErrorMessages()) {
                    mesg.append("Cannot connect to MySQL server on ");
                    mesg.append(this.host);
                    mesg.append(":");
                    mesg.append(this.port);
                    mesg.append(".\n\n");
                    mesg.append("Make sure that there is a MySQL server ");
                    mesg.append("running on the machine/port you are trying ");
                    mesg.append(
                        "to connect to and that the machine this software is "
                        + "running on ");
                    mesg.append("is able to connect to this host/port "
                        + "(i.e. not firewalled). ");
                    mesg.append(
                        "Also make sure that the server has not been started "
                        + "with the --skip-networking ");
                    mesg.append("flag.\n\n");
                } else {
                    mesg.append("Unable to connect to database.");
                mesg.append("Underlying exception: \n\n");
                mesg.append(ex.getClass().getName());
                throw new java.sql.SQLException(mesg.toString(), "08S01");
         * If a connection is in auto-commit mode, than all its SQL
         * statements will be executed and committed as individual
         * transactions.  Otherwise, its SQL statements are grouped
         * into transactions that are terminated by either commit()
         * or rollback().  By default, new connections are in auto-
         * commit mode.  The commit occurs when the statement completes
         * or the next execute occurs, whichever comes first.  In the
         * case of statements returning a ResultSet, the statement
         * completes when the last row of the ResultSet has been retrieved
         * or the ResultSet has been closed.  In advanced cases, a single
         * statement may return multiple results as well as output parameter
         * values.  Here the commit occurs when all results and output param
         * values have been retrieved.
         * <p><b>Note:</b> MySQL does not support transactions, so this
         *                 method is a no-op.
         * @param autoCommit - true enables auto-commit; false disables it
         * @exception java.sql.SQLException if a database access error occurs
        public void setAutoCommit(boolean autoCommit) throws java.sql.SQLException {
            if (Driver.TRACE) {
                Object[] args = { new Boolean(autoCommit) };
                Debug.methodCall(this, "setAutoCommit", args);
            checkClosed();
            if (this.transactionsSupported) {
                // this internal value must be set first as failover depends on it
                // being set to true to fail over (which is done by most
                // app servers and connection pools at the end of
                // a transaction), and the driver issues an implicit set
                // based on this value when it (re)-connects to a server
                // so the value holds across connections
                this.autoCommit = autoCommit;
                String sql = "SET autocommit=" + (autoCommit ? "1" : "0");
                execSQL(sql, -1, this.database);
            } else {
                if ((autoCommit == false) && (this.relaxAutoCommit == false)) {
                    throw new SQLException("MySQL Versions Older than 3.23.15 "
                        + "do not support transactions", "08003");
                } else {
                    this.autoCommit = autoCommit;
            return;
         * gets the current auto-commit state
         * @return Current state of the auto-commit mode
         * @exception java.sql.SQLException (why?)
         * @see setAutoCommit
        public boolean getAutoCommit() throws java.sql.SQLException {
            if (Driver.TRACE) {
                Object[] args = new Object[0];
                Debug.methodCall(this, "getAutoCommit", args);
                Debug.returnValue(this, "getAutoCommit",
                    new Boolean(this.autoCommit));
            return this.autoCommit;
         * A sub-space of this Connection's database may be selected by
         * setting a catalog name.  If the driver does not support catalogs,
         * it will silently ignore this request
         * <p><b>Note:</b> MySQL's notion of catalogs are individual databases.
         * @param catalog the database for this connection to use
         * @throws java.sql.SQLException if a database access error occurs
        public void setCatalog(String catalog) throws java.sql.SQLException {
            if (Driver.TRACE) {
                Object[] args = { catalog };
                Debug.methodCall(this, "setCatalog", args);
            checkClosed();
            String quotedId = this.dbmd.getIdentifierQuoteString();
            if ((quotedId == null) || quotedId.equals(" ")) {
                quotedId = "";
            StringBuffer query = new StringBuffer("USE ");
            query.append(quotedId);
            query.append(catalog);
            query.append(quotedId);
            execSQL(query.toString(), -1, catalog);
            this.database = catalog;
         * Return the connections current catalog name, or null if no
         * catalog name is set, or we dont support catalogs.
         * <p><b>Note:</b> MySQL's notion of catalogs are individual databases.
         * @return the current catalog name or null
         * @exception java.sql.SQLException if a database access error occurs
        public String getCatalog() throws java.sql.SQLException {
            if (Driver.TRACE) {
                Object[] args = new Object[0];
                Debug.methodCall(this, "getCatalog", args);
                Debug.returnValue(this, "getCatalog", this.database);
            return this.database;
         * DOCUMENT ME!
         * @return DOCUMENT ME!
        public boolean isClosed() {
            if (Driver.TRACE) {
                Object[] args = new Object[0];
                Debug.methodCall(this, "isClosed", args);
                Debug.returnValue(this, "isClosed", new Boolean(this.isClosed));
            return this.isClosed;
         * Returns the character encoding for this Connection
         * @return the character encoding for this connection.
        public String getEncoding() {
            return this.encoding;
         * @see Connection#setHoldability(int)
        public void setHoldability(int arg0) throws SQLException {
            // do nothing
         * @see Connection#getHoldability()
        public int getHoldability() throws SQLException {
            return ResultSet.CLOSE_CURSORS_AT_COMMIT;
         * NOT JDBC-Compliant, but clients can use this method
         * to determine how long this connection has been idle.
         * This time (reported in milliseconds) is updated once
         * a query has completed.
         * @return number of ms that this connection has
         * been idle, 0 if the driver is busy retrieving results.
        public long getIdleFor() {
            if (this.lastQueryFinishedTime == 0) {
                return 0;
            } else {
                long now = System.currentTimeMillis();
                long idleTime = now - this.lastQueryFinishedTime;
                return idleTime;
         * Should we tell MySQL that we're an interactive client
         * @return true if isInteractiveClient was set to true.
        public boolean isInteractiveClient() {
            return isInteractiveClient;
         * A connection's database is able to provide information describing
         * its tables, its supported SQL grammar, its stored procedures, the
         * capabilities of this connection, etc.  This information is made
         * available through a DatabaseMetaData object.
         * @return a DatabaseMetaData object for this connection
         * @exception java.sql.SQLException if a database access error occurs
        public java.sql.DatabaseMetaData getMetaData() throws java.sql.SQLException {
            checkClosed();
            return new DatabaseMetaData(this, this.database);
         * You can put a connection in read-only mode as a hint to enable
         * database optimizations
         * <B>Note:</B> setReadOnly cannot be called while in the middle
         * of a transaction
         * @param readOnly - true enables read-only mode; false disables it
         * @exception java.sql.SQLException if a database access error occurs
        public void setReadOnly(boolean readOnly) throws java.sql.SQLException {
            if (Driver.TRACE) {
                Object[] args = { new Boolean(readOnly) };
                Debug.methodCall(this, "setReadOnly", args);
                Debug.returnValue(this, "setReadOnly", new Boolean(readOnly));
            checkClosed();
            this.readOnly = readOnly;
         * Tests to see if the connection is in Read Only Mode.  Note that
         * we cannot really put the database in read only mode, but we pretend
         * we can by returning the value of the readOnly flag
         * @return true if the connection is read only
         * @exception java.sql.SQLException if a database access error occurs
        public boolean isReadOnly() throws java.sql.SQLException {
            if (Driver.TRACE) {
                Object[] args = new Object[0];
                Debug.methodCall(this, "isReadOnly", args);
                Debug.returnValue(this, "isReadOnly", new Boolean(this.readOnly));
            return this.readOnly;
         * @see Connection#setSavepoint()
        public java.sql.Savepoint setSavepoint() throws SQLException {
            throw new NotImplemented();
         * @see Connection#setSavepoint(String)
        public java.sql.Savepoint setSavepoint(String arg0)
            throws SQLException {
            throw new NotImplemented();
         * DOCUMENT ME!
         * @return DOCUMENT ME!
        public TimeZone getServerTimezone() {
            return this.serverTimezone;
         * DOCUMENT ME!
         * @param level DOCUMENT ME!
         * @throws java.sql.SQLException DOCUMENT ME!
        public void setTransactionIsolation(int level) throws java.sql.SQLException {
            if (Driver.TRACE) {
                Object[] args = { new Integer(level) };
                Debug.methodCall(this, "setTransactionIsolation", args);
            checkClosed();
            if (this.hasIsolationLevels) {
                StringBuffer sql = new StringBuffer(
                        "SET SESSION TRANSACTION ISOLATION LEVEL ");
                switch (level) {
                case java.sql.Connection.TRANSACTION_NONE:
                    throw new SQLException("Transaction isolation level "
                        + "NONE not supported by MySQL");
                case java.sql.Connection.TRANSACTION_READ_COMMITTED:
                    sql.append("READ COMMITTED");
                    break;
                case java.sql.Connection.TRANSACTION_READ_UNCOMMITTED:
                    sql.append("READ UNCOMMITTED");
                    break;
                case java.sql.Connection.TRANSACTION_REPEATABLE_READ:
                    sql.append("REPEATABLE READ");
                    break;
                case java.sql.Connection.TRANSACTION_SERIALIZABLE:
                    sql.append("SERIALIZABLE");
                    break;
                default:
                    throw new SQLException("Unsupported transaction "
                        + "isolation level '" + level + "'", "S1C00");
                execSQL(sql.toString(), -1, this.database);
                isolationLevel = level;
            } else {
                throw new java.sql.SQLException("Transaction Isolation Levels are "
                    + "not supported on MySQL versions older than 3.23.36.", "S1C00");
         * Get this Connection's current transaction isolation mode.
         * @return the current TRANSACTION_* mode value
         * @exception java.sql.SQLException if a database access error occurs
        public int getTransactionIsolation() throws java.sql.SQLException {
            if (Driver.TRACE) {
                Object[] args = new Object[0];
                Debug.methodCall(this, "getTransactionIsolation", args);
                Debug.returnValue(this, "getTransactionIsolation",
                    new Integer(isolationLevel));
            if (this.hasIsolationLevels) {
                 java.sql.Statement stmt = null;
                 java.sql.ResultSet rs = null;
                 try {
                      stmt = this.createStatement();
                      String query = null;
                      if (this.io.versionMeetsMinimum(4, 0, 3)) {
                           query = "SHOW VARIABLES LIKE 'tx_isolation'";
                      } else {
                           query = "SHOW VARIABLES LIKE 'transaction_isolation'";
                      rs = stmt.executeQuery(query);
                      if (rs.next()) {
                           String s = rs.getString(2);
                           if (s != null) {
                                  Integer intTI = (Integer) mapTransIsolationName2Value.get(s);
                                  if (intTI != null) {
                                       return intTI.intValue();
                           throw new SQLException("Could not map transaction isolation '" + s + " to a valid JDBC level.", "S1000");
                      } else {
                           throw new SQLException("Could not retrieve transaction isolation level from server", "S1000");
                 } finally {
                      if (rs != null) {
                           try {
                                rs.close();
                           } catch (Exception ex) {
                                // ignore
                           rs = null;
                      if (stmt != null) {
                           try {
                                stmt.close();
                           } catch (Exception ex) {
                                // ignore
                           stmt = null;
            return isolationLevel;
         * JDBC 2.0
         * Install a type-map object as the default type-map for
         * this connection
         * @param map the type mapping
         * @throws SQLException if a database error occurs.
        public void setTypeMap(java.util.Map map) throws SQLException {
            this.typeMap = map;
         * JDBC 2.0
         * Get the type-map object associated with this connection.
         * By default, the map returned is empty.
         * @return the type map
         * @throws SQLException if a database error occurs
        public synchronized java.util.Map getTypeMap() throws SQLException {
            if (this.typeMap == null) {
                this.typeMap = new HashMap();
            return this.typeMap;
         * The first warning reported by calls on this Connection is
         * returned.
         * <B>Note:</B> Sebsequent warnings will be changed to this
         * java.sql.SQLWarning
         * @return the first java.sql.SQLWarning or null
         * @exception java.sql.SQLException if a database access error occurs
        public java.sql.SQLWarning getWarnings() throws java.sql.SQLException {
            if (Driver.TRACE) {
                Object[] args = new Object[0];
                Debug.methodCall(this, "getWarnings", args);
                Debug.returnValue(this, "getWarnings", null);
            return null;
         * Allow use of LOAD LOCAL INFILE?
         * @return true if allowLoadLocalInfile was set to true.
        public boolean allowLoadLocalInfile() {
            return this.allowLoadLocalInfile;
         * DOCUMENT ME!
         * @return DOCUMENT ME!
        public boolean capitalizeDBMDTypes() {
            return this.capitalizeDBMDTypes;
         * After this call, getWarnings returns null until a new warning
         * is reported for this connection.
         * @exception java.sql.SQLException if a database access error occurs
        public void clearWarnings() throws java.sql.SQLException {
            if (Driver.TRACE) {
                Object[] args = new Object[0];
                Debug.methodCall(this, "clearWarnings", args);
            // firstWarning = null;
         * In some cases, it is desirable to immediately release a Connection's
         * database and JDBC resources instead of waiting for them to be
         * automatically released (                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      

  • Anyone know how to insert to multiple tables on Dreamweaver?

    Hey everyone,
    I'm a bit of a newbie at PHP and am trying to create my first "dynamic" site.  I have a registration table with fields idNo (primary key & auto-increment), username, password, email.  I also have another table called profile with fields idNo, location, musicalInfluences, aboutMe etc.  All of these fields except idNo have the default value of "update."  What I want to be able to do is add a second insert statement to the user registration behaviour so that I can have the idNo number added to the profile tables as well as the registration table.  That way the registration and profile are linked by idNo and I can create a record-set do automatically populate the profile table on my profile page when the user logs in.  All of the different profile traits would say "update" and I can then use an update server behaviour for the user to update there profile.
    I might be approaching this the wrong way so I'm open to suggestions on how to create a user login and linked profile page.  One thing I could not work out was how, when the user clicks login with the correct credentials,  I was supposed to separate a first time user, directed to the create profile page, from a user who has already created a profile page and just wants to see it.  The only way I could think of was by using the default method explained before and then having an update page.  Sorry if that was a bit of a waffle.  Here is my code.  Any help would be much appreciated!!
    This is the script that I have included on my registration page.  I just extracted the php and used an include to keep the html page tidy.
    <?php require_once('Connections/soundstorm.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    // *** Redirect if username exists
    $MM_flag="MM_insert";
    if (isset($_POST[$MM_flag])) {
      $MM_dupKeyRedirect="usernameExists.php";
      $loginUsername = $_POST['username'];
      $LoginRS__query = sprintf("SELECT username FROM registration WHERE username=%s", GetSQLValueString($loginUsername, "text"));
      mysql_select_db($database_soundstorm, $soundstorm);
      $LoginRS=mysql_query($LoginRS__query, $soundstorm) or die(mysql_error());
      $loginFoundUser = mysql_num_rows($LoginRS);
      //if there is a row in the database, the username was found - can not add the requested username
      if($loginFoundUser){
        $MM_qsChar = "?";
        //append the username to the redirect page
        if (substr_count($MM_dupKeyRedirect,"?") >=1) $MM_qsChar = "&";
        $MM_dupKeyRedirect = $MM_dupKeyRedirect . $MM_qsChar ."requsername=".$loginUsername;
        header ("Location: $MM_dupKeyRedirect");
        exit;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "registerForm")) {
      $insertSQL = sprintf("INSERT INTO registration (username, password, email) VALUES (%s, %s, %s)",
                           GetSQLValueString($_POST['username'], "text"),
                           GetSQLValueString($_POST['password'], "text"),
                           GetSQLValueString($_POST['email'], "text"));
      mysql_select_db($database_soundstorm, $soundstorm);
      $Result1 = mysql_query($insertSQL, $soundstorm) or die(mysql_error());
      $insertGoTo = "registerSuccess.html";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $insertGoTo));
    ?>

    you can use a trigger in mysql. this trigger is for new records in your registration table. you can use mysql's last_insert_id() to get the last record inserted. just search for mysql triggers to get more info. note that this is not php code, it is mysql.

  • Php credit card processing

    My merchant account company is raising my rates and making me buy new software. I am looking for a different solution and anyone familiar with credit card processing may be able to give me some good advice.
    Up until now, I used software that I installed on my computer that would enable me to process transactions over the Internet. My question is: When someone gives me a credit card number, can I process credit cards using a secure page coded with php? I have a dedicated IP, I can get an SSL certificate, and I can sign up with a credit card gateway like Authorize.net. Why would I need a merchant account (who will charge me a percentage of everything I make)?
    There are a number of good php credit card processing scripts available. Can I bypass the merchant account company using a php page that will process my credit cards?

    Hi John
    The php code and the process are tightly related when it comes to processing your own credit card transactions and then passing them on for payment authorisation.
    All the items must be done on secure server section of site, and will depend on if you wish to create a user account or not, this is for the non-user account
    Customer fills in Their details on order form, (Name address, credit card info, etc.)
    Details stored in temp database for such transactions via a php back-end script, using encryption for credit card details.
    Customer is then shown a confirm page, with the details of the order, only the last four digits of the credit card number are shown.
    If the user clicks 'place order' another back-end php script transfers the details to a permanent database and send the details for transaction conformation to your credit card authorization gateway.
    Payment status sent to another back-end processing script for completion of transaction, this is often done via ipn or similar system.
    Confirm payment and details are displayed to the customer, along with your transaction number, (this one may be omitted) and customer order no.
    That's basically the procedure, the scripts can be on the same page using functions, or separate scripts if using procedural code. There are obviously many variations on this procedure but this one is probably the most common.
    The use of  'secure pay' adds another two steps to this procedure in that the customer is sent to their card providers site for a second step to the authentication. There they must give a user name and password, (previously agreed and confirmed, if not it gets more complicated) in order to confirm that they are the card holder, before the actual card transaction can continue. To give you some idea of the complexity of the 'secure pay' set-up, the general extra cost can range anywhere between $1000 and $3000, (depending if done within web site development budget, or as an extra) converting from U/K £ to $.
    BTW, The secure pay is normally used by bank card processing, these used to be know as 'Merchant Accounts', but paypal and others started using this term for their accounts which complicated the issue, the bank processing is what I am referring to with this term, and the fact that visa and mastercard use a different processing procedure is why I say, 'avoid'.
    (Sorry if this explanation is a little long, but once you go outside the standard card processing, it does get more complex).
    I came across a web site (hotscripts.com) and found some PHP scripts
    that
    process credit cards.
    Unless you are happy adding extra security checks to the code to validate your site is the one using it, try to avoid any scripts that are 'in the public domain'. This is not said with any prejudice or doubt regarding the code, more that once you process your own credit cards you become completely responsible, (legally) for any fraud or misuse that results from your scripts/site.
    One other item is that I would recommend using PHP:PDO with MySQL transactions and bound-parameters/stored procedures for this, mainly because they adds extra levels of security and redundancy to the procedure, which is not possible using the standard php/mysql code.
    Hope this clears a few details up.
    Paula Z

  • Is JBoss a right solution for me?

    Hi,
    I want to develop web services using Apache XML-RPC and standard Java Objects, no EJB's. I require "Connection Pooling" feature available in JBoss. I am planning to use MySQL Transactions available in MySQL Connector /J and caching in MySQL using query-cache directive in my.cnf. I should be able to configure Virtual Hosts in the Application server to deploy different web services in different url's. I am not able to decide whether JBoss is a right Application server for my problem. If yes, can I disable EJB from JBoss. If I don't disable EJB from JBoss, is it an overhead. Please advise me.
    Thanks a lot.

    If you don't need EJBs, you can go with Tomcat as your servlet/JSP engine. It does connection pooling.
    %

  • SIP server ver 2.1

    Hello,
    Are there anybody using sip ver 2.1?
    We are going to upgrade from 2.0 to 2.1
    but see that changing the IP address of the SIP requires uninstall all SIP and install again with a new IP !
    However in SIP 2.0 we can change the IP address
    of the SIP as usual.
    Is there any way to change the IP of sip 2.1
    without uninstall the whole server ? :-)
    Regards,
    HA

    There are several ip's you have to change.
    First you have to change the ip addr of the physical interfaces and then you can change the addresses in the sipd.conf file.
    This file contains the ip's of the SPS used in the SIP messages and also the addresses used in the MySQL transactions.

  • PSTN users VM not delivered to subscriber

    Hi ,
    I am facing an strange issue in cisco unity 5.0 with Exchange 2003 and exchange 2010.
    Whenever an local ip phone user calls and leaves a voice mail to another user, the message will get delivered to subscriber mailbox successfully.
    But if any PSTN user calls the IP Phone user and leaves a voice mail it does not get delivered to subscriber mail box , instead VM moves to "UnityMTA/failed" folder.
    In event viewer i get logs of  CiscoUnity_UMR error.
    Event Type:          Error
    Event Source:          CiscoUnity_UMR
    Event Category:          UMR Thread Error
    Event ID:          113
    Date:                    1/14/2014
    Time:                    7:39:57 PM
    User:                    N/A
    Computer:          UNIWELSERV01
    Description:
    A message with the subject:
    Message from 91966445XXXX
    to recipient hp_utpalbhattacharjee could not be delivered [Error:800404DC]. It was moved to the failed directory.  This can occur for several reasons: the recipient mailbox may be disabled or inaccessible, Cisco Unity may be having trouble connecting with the partner server, or the Cisco Unity messaging component may not be properly configured.  If this condition persists, contact Cisco TAC. 0x00001098
    i have also deleted and re-created MAPI  , still no luck.
    Can someone help me on this ,
    Thanks in advance,
    Siddu

    Problem solved. Many configuration changes are made in DBAdapter configuration and Connection pool configuration.
    Home >Summary of Deployments >DbAdapter >Summary of JDBC Data Sources >MyOutboundConnectionPool
    Driver Class Name: com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
    for XA transaction
    Home >Summary of JDBC Data Sources >webjet >Summary of Deployments >DbAdapter >Summary of JDBC Data Sources >MyOutboundConnectionPool: Outbound Connection Properties
    platformClassName     org.eclipse.persistence.platform.database.MySQLPlatform
    for MySQL
    Transaction Support: XA Transaction

  • Pipe email using aliases file

    I am trying to pipe an email into php script using the aliase file in postfix. My test script looks like this:
    <?php
    $fd = fopen("php://stdin", "r");
    $email = "";
    while (!feof($fd)) {
    $email .= fread($fd, 1024);
    fclose($fd);
    if($fd){
    $data = "Mail received\n";
    $fp = fopen("result.txt", "w");
    fwrite($fp, $data);
    fclose($fp);
    ?>
    The script works from the command line if I issue something like 'cat <email #> | php script.php'. I have this line in my aliases file:
    testuser: | "/usr/bin/php /Volumes/path/to/script.php"
    When I send a test email I receive an 'Undelivered Mail Returned to Sender' reply with the following line:
    'Command died with status 1: "/usr/bin/php /Volumes/path/to/script.php". Command output: Could not open input file: /Volumes/path/to/script.php'
    I have found similar problems like this on the web but no one seems to find an answer. I have tried various permissions and owners, I have also tried various ways to enter in the alias line, making sure to issue 'sudo newaliases' after each change. Is it the script, Postfix or something else?
    Thanks,
    Nick

    Im doing the same thing with no trouble... a few slight differences...
    1. I only pipe to the path of the script, not the php executable:
    quaynotifydaemon: |"/usr/local/bin/quaynotify.php"
    2. I don't use fwrite in my script:
    // Read standard input
    $fd = fopen("php://stdin", "r");
    $email = "";
    while (!feof($fd)) {
    $email .= fread($fd, 1024);
    fclose($fd);
    After that, is the meat of my script, which does some mysql transactions and some other stuff.
    Also, FYI the privileges of my php file are 755:
    $ls -al /usr/local/bin/quaynotify.php
    -rwxr-xr-x 1 admin wheel 10586 Jun 4 10:52 /usr/local/bin/quaynotify.php

  • Why event published by composite publisher is not delivered to subscriber

    Hello.
    Why event published by composite publisher is not delivered to subscriber but same event published by test Business event is delivered?
    Which points are necessary to deliver published event to subscriber. I use same EDL/XSD files for publisher and subscriber to assure using same event.
    Here is example content of message published by composite and used to publish by test Business event:
    <message>
    <properties>
    <property name="tracking.compositeInstanceId" value="220056"/>
    <property name="tracking.ecid" value="531982e54d355120:-5544feab:1320045804b:-7ffe-0000000000182444"/>
    <property name="tracking.conversationId" value="52%401315226747"/>
    </properties>
    <parts>
    <part name="payload">
    <BasketInvoiceCollection>
    <BasketInvoice>
    <basketInvoiceId>52</basketInvoiceId>
    <loggedUserId>1</loggedUserId>
    <statusId>1</statusId>
    </BasketInvoice>
    </BasketInvoiceCollection>
    </part>
    </parts>
    </message>
    I found problem in server diagnostic log about XA transaction. For information I running against MySQL database.
    Edited by: Peter551059 on Sep 6, 2011 2:40 PM

    Problem solved. Many configuration changes are made in DBAdapter configuration and Connection pool configuration.
    Home >Summary of Deployments >DbAdapter >Summary of JDBC Data Sources >MyOutboundConnectionPool
    Driver Class Name: com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
    for XA transaction
    Home >Summary of JDBC Data Sources >webjet >Summary of Deployments >DbAdapter >Summary of JDBC Data Sources >MyOutboundConnectionPool: Outbound Connection Properties
    platformClassName     org.eclipse.persistence.platform.database.MySQLPlatform
    for MySQL
    Transaction Support: XA Transaction

Maybe you are looking for

  • TS1717 Apple mobile device failed to start

    During installation of iTunes, error message: Apple mobile device failed to start and something about not having "privileges" Some ideas?

  • Billing document not transferrred to Accounting:  Msg no. KE350

    Dear All. We're having an issue in SD Billing.  Some billing documents error out when released to accounting. This is due to a material on the billing document, which is set up as FERT but they are also checked field 'Do not Cost' on the material mas

  • Mavericks wont install

    As many others, i get following message: The thing is, I've already tried what people said in here. I have a backup on an external drive. I found the backups.backupdb folder on that and deleted it, but that obviously didn't help. Now i've created a n

  • Receivables report - customer/transactions/receipt activities report

    is there any standard receivable report that can show all activities of transactions and receipts? something like the combination of 'applied receipt register' and 'unapplied receipt register'. or a statement of account that just show everything for

  • Budget control system and former budgeting

    Dear All, Can anyone tell me the main difference between former budgeting and BCS. Kind Regards, Rajini.