Piotras' blog: Archive
2007-07-01 - 2007-07-31
Midgard2 and Oracle
Posted on 2007-07-03 08:37:39 UTC.
Yesterday I tested Midgard2 libraries with Oracle database.
Download deb or rpm files ( install them of course ): http://www.oracle.com/technology/software/products/database/xe/htdocs/102xelinsoft.html
Make sure you have libgda configured and compiled with Oracle support. If you configure on debian and already have oracle debs installed, configure oracle support ( for libgda ) like this:
--with-oracle=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
Configure Midgard configuration file. Define Oracle provider.
Type=Oracle Name=XE Username=system Password=secret
By default XE database is created so make sure you have defined this database and it also exists in /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin/tnsnames.ora file.
Export ORACLE_HOME.
export ORACLE_HOME="/usr/lib/oracle/xe/app/oracle/product/10.2.0/server"
If ORACLE_HOME is not set , you should get error message like this:
midgard-core (pid:5222):(WARNING):Not connected to the Midgard database Database XE@. Could not initialize Oracle
- Start midgard application.
In my case midgard-schema has been used with TableCreate option set to true. Unfortunatelly libgda doesn't support table create spec file for Oracle provider so all I got from application is this error:
midgard-core (pid:5226):(WARNING):Midgard connection error: ORA-00942: table or view does not exist
, No:(942), src:gda-oracle:gda-oracle-provider.c:666, SQL: Not available midgard-core (pid:5226):(WARNING):Can not prepare create statements for table 'repligard. Missing spec. file '(null)'
Let's hope Oracle spec files will be added soon.
Midgard and Midgard2 on the same host.
Posted on 2007-07-07 21:03:59 UTC.
So, I told few guys I have Midgard 1.8.3 and Midgard2 installed on my laptop ( aka development machine ). Tarjei also asked me about how to do it, and I think that blogging about this is much better idea than answering few mails ( or dozens in a future ).
Problem is not easy to solve. It's not easy as it's not easy to have PHP4 and PHP5 loaded at the same time for the same Apache server. But if you have Debian installed, solution might be easy. First of all, Debian ships both Apache and Apache2 packages. Both PHP4 and PHP5. And Midgard fortunatelly provides two different library files:
- libmidgard9.so for Midgard
- libmidgard-2.0.so for Midgard2
As long as you compile other libraries or applications against correct library , you should not be afraid about nasty segfaults triggered by invoking the same function name.
OK, what exactly I did? Midgard-php module from 1.8 branch must be PHP4 compatible, so using pure PHP5 features doesn't make sense in application which is designed also for PHP4. Midgard-php extension ( PHP language bindings for Midgard ) fully supports PHP5 ( ZE2 ) , and only PHP5.
Solution is simple. Install php4 and php5 packages. Install debian packages for Midgard-1.8.3 with php4-midgard extension and compile Midgard2 ( from trunk ) with PHP5. This at least resolves cli problem. Install apache and apache2 debian packages. libapache-mod-midgard package can be used for Midgard, while midgard-apache2 module can be self compiled. The latter solution is not tested by me, but I think I could create "backward friendly" debian packages for developers.
Midgard2 library doesn't provide legacy midgard-config application, so conflicts may be seen in schema files. However, those will be not changed too much in near future. midgard-data package with datagard is also "forgotten" for a while in new Midgard2 architecture. midgard-schema supports almost the same config file and implementation is encapsulated in library ( two libraries in our case ).
And even, if you need two different config files for the same Database, one may be loaded from system configuration dir ( /etc/midgard in most cases ) and another one from user's conf dir ( $HOME/.midgard/conf.d ).
While I am writing this, I wonder if this would be good idea to rename midgard-php extension .so file. This also could help developers who do not use debian daily. midgard-php extension provided by Midgard2 can be loaded ( via dl function ) as many times as needed without causing any issues.
Apache module and its environment seems to be an issue still, but one is not used to switch development environment every 15 minutes.
This is not real howto. It's only idea, how this can be made when you have debian installed. There are still many problems which must be resolved, but at least start point seems to be easy.
We won again ( aka Ragnarok preparation :)
Posted on 2007-07-17 10:42:47 UTC.
Needless to say, I started my Ragnarok preparation, and together with Aga, visited Battle of Grunwald reconstruction place last sunday (the latter site unfortunatelly reached bandwidth limit). Also ( unfortunatelly ) our camera died last friday, so we had to depend on mobile phones' built-in ones. Believe me, it's Canon and hitting it down the ground didn't help, even I heard it usually help with canon though ;)
We spent plenty of 800 kilometers in car , and you could know what it means if you know what driving in Poland means. Luckilly, we were able to be witnesses of reconstruction and visit Malbork with wonderfull 600 years old castle. Bergie told me that few his friends are in Grunwald and are active battle members. We were wondering if we could meet them somehow, but as soon as I took Aga's phone to take this picture I realized that I lost her, and can not even make a phone call because I have both mine and her phone. Can you imagine? Find one person quickly among 100 000 others? When we found ourselfes we agreed that it's impossible to find few guys in such huge crowd.
After two rainy weeks, we got excellent weather with sun burning our skins. If you're going to visit Poland and have possibility to be in Malbork, do it. Remember that you need at least 3~4 hours to see castle "in brief". Probably next year we will take Ola with us, but this year we had to check "logistics" possibilities of those two places. You know, 5 years old girl is not going to be "nice" when you stay in car 1~2 hours because of endless queues, so next time we need to have tents with us and stay on "Grunwald Fields" couple of days to also see "bohurts".
Midgard2 - Ragnarok preparation
Yesterday and today I changed default directories and some files used by Midgard2 CMF.
midgard-core
- Fully separated library files
- Configuration files stored in midgard2 directory
- Required xml files stored in midgard2 directory
- midgard-schema command line tool renamed to midgard2-schema
midgard-apache
- module renamed to __mod_midgard2.so__
midgard-php5
- extension renamed to midgard2.so
With this approach ( at this moment ) , every developer can install Midgard 1.8.x and Midgard2 and configure only module and extension files' names in midgard's httpd.conf and php.ini files.
Ah! Last but not least! N800 has been more than helpfull during this weekend. I updated debian files for midgard-core, so now there's architecture "autodetection" to build armel and i386 packages even easier.
A piece of "clean" history
Posted on 2007-07-22 22:17:38 UTC.
I just noticed new pictures uploded by Bergie, and I reminded myself some interesting story while looking at this photo.
Henry III of France unfortunatelly has been King of Poland, and fortunatelly here in Poland , he discovered something which is known as toilet. When he came back to France he ordered to build ones in Louvre. Also, in Poland he saw a fork for the first time in his life.
I couldn't believe it, but at least Polish wikipedia says so.