Skip to content

Propel ORM, schema.xml, the missing autoIncrement value and a not working "$propelObject->reload()" with mysql greater 5.1

So i had to evaluate a migration of an existing application from mysql 5.1 to mysql 5.5. Yes i know, the gap between 5.1 and 5.5 is tremendous but the system was working without any problems for a long time of periode.

After switching a test environment from 5.1 to 5.5 there was one unittest failing. What was so special in that given unittest? For a reason, we needed to execute the native propel method "reload" right after a "save". The test was failing because of an empty value for the "id". The representing database table has a column id with an autoincrement flag. With mysql 5.1, everything is working as expected. The id was available after the reload so everything was fine.

After switching to 5.5, no id was available after calling "save". This leads to the fact that propel was failing by executing the "reload" method. Switching back to mysql 5.1 and the error was gone. After search in usergroups, issuepages i still could not find any matching issue or entry. Finally i presentend my problem on the #propel channel in freenode and got some feedback. One guy had experienced the same error in the past. He could remember that this problem occures while switching to mysql 5.3 or 5.4. Niceguy exptom wrote that goosed him with my report and he will give the problem a debug session try.

On the next day, he quickly responded and presented his results. He (if he is a he and not a she) told me he could takle it down to a missleading schema.xml. The column where the error occures had a missing autoIncrement="true" value. I took a look into my current schema.xml and bam same flaw.

The rest is quite easy. Update schema.xml, rerun propel generation and testing. Everything is now working fine. Thanks to exptom again. I guess the schema.xml would have been one of the last areas i had debugged.

PHPUGHH130611 - composer introduction and MySql Database Clustering

Where

Mindworks Jarrestraße 42A Hamburg

InnoGames Game Jam - By Frank Sons

  • 48 hours to develop a game
  • Can work alone or in pair
  • Free food and drinks
  • From 21 June to 23

Game Jam

So Coded - A Web Conference In Hamburg - By Ole Michaelis

  • A lot of cities currently have conference
  • Hamburg also should have one
  • A lot of speakers from hamburg (and germany also ;-))
  • Its not only for java script or php guys
  • 19 - 20 of September 2013

so coded

Introduction To Composer - By Till Klampäckel

Composer - What is it?

  • Dependency management
  • Helps to keep components as components (with a maintainer)
  • Breaking up dependencies for development (and what is needed for production system)
  • Deployment tool
  • Update your dependencies
  • Generates autoloading

Composoring Your Code

Simple Example For composer.json


{
    "name": "net_bazzline/example-library",
    "licenses": "GPLv3"
}

Releases


git tag -a 1.0.0 -m "My first release"

Consuming - Using A Library (By Using Packagist And Git)


{
    "name": "artodeto/my-application",
    "repositories":
    [
        {
            "type": "vcs",
            "url": "https://github.com/stevleibelt/php_net_component_converter"
        },
        {
            "type": "package",
            "package": {
                "name": "company/legacy-code",
                "version": "1.2.3",
                "dist": {
                    "url": "https://dev.mycompa.ny/code.tar",
                    "type": "tar"
                }
            }
        }
    ],
    "require": {
        "net_bazzline/example-library": "*"
    }
}

Install


sudo su
mkdir -p /usr/local/bin/composer/
cd /usr/local/bin/composer/
curl -sS https://getcomposer.org/installer | php

Deployment - Things That Can Go Wrong

  • Github is down
  • Minimum stability or prefer stable (use dev or oder stability)
  • Versioning is hard (require a special version like 1.2.*)

Links

Easybib.com
Imagineeasy.com
Versioneye.com
Packagist.org
Satis
Semver

Others

  • Something similar to composer exists for java script
  • semantic versioning

MySql Database Clustering - by Ulf Wendel (ulf.wendel@oracle.com)

  • great speaker -> try to get a free presentation :-) Ulf Wendel

Theory

  • Availability
  • Scalability
  • DistributionTransparency

What Kind Of Clusers

  • Transactions (where)
  • Synchronization (when)

Important Keywords

  • Concurrency control
    • Atomic commit
    • Atomic broadcast (virtual synchrony offering total-order delivery)
  • Certification: detect conflict
  • Quorum (better than ROWA - read from one, write to all?)
  • Fault Tolerance
  • Virtual Synchrony
  • Reliable, delivered vs receieved (for example, update transactions should receive the application layer at the same ordering)
  • MySQL DBMS (with a Reflector and Replicator connected via Group Communication System (GCS) - not available so far)
  • MySQL Cluster Replication (hybrid, extends MySQL with a Reflector Plugin (Database engine: NDB Storage Engine and) and Replicator (NDB Data Node and Replicator (NDB Data Node)) with "fire and forget" api
  • Partitioning (auto sharding)
  • Tune your partitions