Informix write listener – Rest API setup issues

For my talk at IIUG 2017 I was working with the wire listener on Informix.

When setting up a wire listener for the REST API I found some Informix packaging issues and issues with the DeveloperWorks article.

I was following the developerWorks article Informix and NoSQL: First Steps with the REST API

NOTE: This series of articles REALLY helped when getting my talk ready!

I was working with the latest Informix server version 12.10.FC8 on CentOS 7 and found:

a) When unpacking nosql_sdk.zip this unpacks to folder nosql-sdk-1.2.2 – there was no explict step with the command to add a link called nosql_sdk to make the examples work, I add this below.

cd $INFORMIXDIR
unzip bin/nosql_sdk.zip

ln -s nosql-sdk-1.2.2 nosql_sdk

b) The library ${INFORMIXDIR}/nosql_sdk/tomcat-embed-core.jar is missing!

Noticing that the other libaries were for version 8.0.38 I went to

Tomcat Embed Core » 8.0.38

and on the “Files” line clicked the download link.

I then copied tomcat-embed-core-8.0.38.jar into $INFORMIXDIR/nosql_sdk/lib

and added this to the classpath.

3. In order to get class com.ibm.nosql.server.ListenerCLI I also had to add ${INFORMIXDIR}/nosql_sdk/com.ibm.nosql.informix-1.2.2.jar to the classpath.

The final result was:

cat rest_listener_start.sh
#!/bin/sh

${INFORMIXDIR}/extend/krakatoa/jre/bin/java \
-cp ${INFORMIXDIR}/bin/jsonListener.jar:${INFORMIXDIR}/nosql_sdk/lib/tomcat-embed-core-8.0.38.jar:${INFORMIXDIR}/nosql_sdk/com.ibm.nosql.informix-1.2.2.jar \
com.ibm.nosql.server.ListenerCLI \
-config ${INFORMIXDIR}/etc/restListener.properties \
-logfile /work/martinfu/731/restListener.log \
-start &

exit

cat rest_listener_stop.sh
#!/bin/sh

${INFORMIXDIR}/extend/krakatoa/jre/bin/java \
-cp ${INFORMIXDIR}/bin/jsonListener.jar:${INFORMIXDIR}/nosql_sdk/lib/tomcat-embed-core-8.0.38.jar:${INFORMIXDIR}/nosql_sdk/com.ibm.nosql.informix-1.2.2.jar \
com.ibm.nosql.server.ListenerCLI \
-config ${INFORMIXDIR}/etc/restListener.properties \
-stop

exit

I hope this helps and am talking to IBM about the issues I found.

 

Advertisements

Simple Informix C UDR on Centos 6.6

Simple Informix C UDR on Centos 6.


#include "dmi/mi.h"

mi_integer bigger_int(mi_integer left,mi_integer right)
{
if ( left > right )
return(left);
else
return(right);
}

To compile

gcc -I$INFORMIXDIR/incl -I $INFORMIXDIR/incl/esql -c -fPIC -DMI_SERVBUILD -g bigger_int.c
gcc -shared -fPIC -o /home/informix/bigger_int.so bigger_int.o

To load and run

dbaccess sysmaster

create database justdave;

CREATE FUNCTION bigger_int (arg1 integer, arg2 integer) RETURNING integer
EXTERNAL NAME '/home/informix/bigger_int.so(bigger_int)'
LANGUAGE C;

select bigger_int(1,2) from systables where tabid=1;

DROP FUNCTION bigger_int;

Only when you execute the function is the shared library loaded

05:20:41  Loading Module
05:20:41  pid 3217: ELF .eh_frame section missing in /opt/IDS.12.10.FC5/gls/dll/64-libicudata.so.48
05:20:41  The C Language Module loaded


Informix 12.10.xC5 is out!

Informix 12.10.xC5 is out

https://www-01.ibm.com/support/knowledgecenter/SSGU8G_12.1.0/com.ibm.po.doc/new_features_ce.htm?lang=en-us#newxc5_toc

– AUTO_REPREPARE changes,

– Rolling upgrades for high-availability clusters

– Support for Java 7

– Improved installation logging and debugging

– Easier silent installations

– Tenant databases session_limit_memory,session_limit_logspace,session_limit_txn_time,tenant_limit_space

– Limit access to tenant databases in OAT

– Limit session resources SESSION_LIMIT_MEMORY,SESSION_LIMIT_TEMPSPACE,SESSION_LIMIT_LOGSPACE,

SESSION_LIMIT_TXN_TIME

– Larger maximum tape size for backups TAPEDEV/LTAPEDEV 9 ZB

– Informix JDBC Driver now supports the Estonian and Lithuanian locale, et_ee

– Correlated aggregate expressions

– Control repreparation IFX_AUTO_REPREPARE new values

– Manipulate JSON and BSON data with SQL statements

– High availability for MongoDB and REST clients

– Wire listener configuration enhancements

– Wire listener query support, Join/Array queries on JSON data

– Enhanced account management through the wire listener,JSON lockAccount and unlockAccounts commands

– Load pure JSON documents into time series, TSL_PutJson

– Faster loading of time series data files
TSL_Put function can now contain JSON or BSON documents as values
for columns other than the primary key and time stamp columns
– Improved logging for the time series loader
You can choose to retrieve loader messages from a queue instead of logging the
messages in a message log file. Retrieving messages from a queue results in less
locking contention than logging messages in a file.
TSL_GetFmtMessage/TSL_GetLogMessage/TSL_MessageSet

– Create new time series while loading data,TSL_SetNewTS/TSCreateVirtualTab

– Display time series storage space usage,TSInfo

– View active time series loader sessions,TSL_ActiveHandles

– Analyze time series data for matches to patterns,TSPatternMatch/TSCreatePatternIndex

– Clip selected columns of time series data,ProjectedClip

– Track moving objects
The spatiotemporal search extension depends on the TimeSeries and spatial extensions.
You store the spatiotemporal data in a TimeSeries data type with columns for longitude and latitude.
You index and query the spatiotemporal data with the new spatiotemporal search functions.
You can also query spatiotemporal data with time series and spatial routines.

IBM Informix Spatiotemporal Search for Moving Objects User’s Guide.
https://www-01.ibm.com/support/knowledgecenter/SSGU8G_12.1.0/com.ibm.sts.doc/sts.htm?lang=en-us
– Enhancements to Informix Warehouse Accelerator
– accelerate queries that include these scalar functions: CURRENT, SQRT, and SYSDATE.
– ondwa listmarts command
– load data marts faster by adding a second DWAVP virtual processor
The DWAVP virtual processor runs Informix Warehouse Accelerator administrative
functions and procedures.


Database product installation FAQ

Database product installation FAQ http://www.smooth1.co.uk/installs.html

Currently SQL Server,DB2 10.5,Oracle 12.1.0.2,SAP ASE 16.0,Informix 12.10.FC4