Save 
Join IIUG
 for   
 

Informix News
29 July 09 - Wall Street Journal - IBM to Acquire SPSS, Adding to Acquisitions... Read
11 February 09 - InformationWeek - IBM Drifts Slowly Toward Mainstream Cloud Computing... Read
11 February 09 - CNNMoney.com - IBM to Deliver Software via Cloud Computing With Amazon Web Services... Read
07 January 09 - Huliq News - IBM Power Servers Helps Bank of Chengdu Build Up Core Banking System.. Read
04 December 08 - Steeleye - Multicarta achieves 99.997% uptime for its Informix-based Credit Card Authorization Centre... Read
16 October 08 - VendorRate - Informix Earns Top Customer Satisfaction Score on VendorRate in Q3... Read
14 August 08 - IIUG.org - Sellout Expected for the 2009 IIUG Informix Conference... Read
29 April 08 - IntelligentEnterprise.com - IBM Informix Upgrade Enhances Clustering, Database Management... Read
29 April 08 - itweek.com - IBM 'Cheetah 2' mauls data costs... Read
28 April 08 - eWeek.com - IBM Uncages Cheetah 2 Data Server... Read
28 April 08 - CNNMoney.com - IBM Helps Clients Reduce Data Management Costs With New Informix Dynamic Server... Read
09 April 08 - CNNMoney.com - MediaSpan Embeds IBM Informix Dynamic Server Software for Delivering News to Print, Web and Wireless Devices... Read
08 April 08 - IT-Director.com - Informix seeks developers... Read
18 February 08 - marketwire.com - Icarus Studios Partners With IBM to Upgrade Performance, Availability for Its Online Games... Read
17 January 08 - eWeek.com - IBM Adds Mac Support to IDS for Higher Education... Read
17 January 08 - informationweek.com - Lotus Notes For iPhone Signals Closer Ties Between IBM, Apple... Read
16 January 08 - marketwire.com - IBM Informix Dynamic Server to Deliver Support for Mac OS X... Read
16 January 08 - internetnews.com - IBM's IDS to Support Mac Platform... Read
28 June 07 - REG Developer - IBM and Informix tie down Cheetah... Read
27 June 07 - CBRonline.com - IBM corrects its own Informix customer figures... Read
14 June 07 - vnunet.com - IBM changes spots with Informix 'Cheetah' database... Read
14 June 07 - eChannelLine - IBM expands scope for IDS... Read
14 June 07 - Resellernews - IBM: Informix database alive and kicking... Read
13 June 07 - DB2 Magazine - Cheetah is now out of the gate... Read
12 June 07 - IBM - IDS 11 release announcement (pdf)... Read
12 June 07 - ChannelWeb Network - IBM Uncages IDS 11, Aka Cheetah, Database... Read
12 June 07 - eWeek.com - IBM's 'Cheetah' Ready to Pounce... Read
12 June 07 - InformationWeek - IBM Unleashes 'Cheetah' Database... Read
12 June 07 - WebWire - IBM Strengthens Database Portfolio With New Informix Dynamic Server... Read
12 June 07 - Intelligent Enterprise - IBM Unveils Informix Upgrade... Read
12 June 07 - ComputerWeekly.com - IBM's Cheetah IDS makes leap to better data centre clustering... Read
12 June 07 - ebiz - IBM Unveils Next Generation Informix Dynamic Server... Read
12 June 07 - computerworld.com - Will 'Cheetah' help IBM's Informix chase down market share?... Read
12 June 07 - Internetnews.com - No Data Can Outrun This 'Cheetah'... Read
12 June 07 - de.internet.com - IBM neuer Datenbank-Server mit Codenamen Cheetah ist fertig... Read
12 June 07 - verifox.de - IBM stärkt Datenbank-Portfolio mit neuem Informix Dynamic Server... Read
12 June 07 - golem.de - Informix 11 vorgestellt... Read
12 June 07 - Computerwoche.de - IBM stellt neue Informix-Version vor... Read
12 June 07 - IBM.de - IBM stärkt Datenbank-Portfolio mit neuem Informix Dynamic Server... Read
12 June 07 - Heise - IBM gibt Informix 11 frei... Read
25 May 07 - Taiwan.CNET.com - Local Taiwan Informix user group established... (Chinese language) ... Read
18 May 07 - ChannelWeb Network - IBM Musters Partners For Cheetah Release... Read
18 May 07 - eWeek.com - IBM Looks to 'Cheetah' to Speed Up Blade Servers... Read
7 May 07 - DB2 Magazine - SQL Shortcuts - Use these tricks to generate IDS SQL scripts... Read





End of Support Dates

[ View Thread ] [ Post Response ] [ Return to Index ] [ Read Prev Msg ] [ Read Next Msg ]

Development Tools Forum

Re: Java with informix 4gl shared objects

Posted By: Jonathan Leffler
Date: Saturday, 18 March 2006, at 11:31 p.m.

In Response To: Java with informix 4gl shared objects (MARK TYRER)

On 3/13/06, MARK TYRER <m_tyrer@hotmail.com> wrote:
> Tried posting to the classics sig - and they suggested that I try this one.
>
> I have a need to expose functions within an informix shared object (compiled
> with informix 4gl 7.3 running against informix 7 db) to Java. The need is such
> that I must be able to call the java classes remotely. Currently I have been
> able to create a JNI wrapper for the shared object and am able to connect
> using RMI. For a performance test, I iterated a simple function, a 1000 times
> without a problem. However, as soon as I try to connect with a second session
> (Running the same performance test), The java server class falls over because
> the shared object reports a -439 error.

Are you using threaded Java? I4GL code is not designed for use in
threaded programs, and does not use thread-safe ESQL/C libraries.
That could be the first problem - or it might be irrelevant.

What is the message for error -439? Most people don't recall all the
error messages (not even I do) and I had to go look it up. Please
review: http://www.catb.org/~esr/faqs/smart-questions.html for a
discussion on this.

-439 Database server is currently processing an SQL task.

This sounds ominously like a multi-threaded application trying to use
the same connection for two different tasks at the same time. Failing
that, it means that you somehow not waiting for the server to complete
one task on the connection before attempting to do a second, and that
normally implies multiple threads of control.

> My java is a little shakey at best, so the answer may be staring me in the
> face. (Here is what I suspect - not what I know) However, my suspision is that
> the rmiregistry is a single process on the host box and runs the server
> classes. I think that when I run the native function an informix connection is
> formed. When the second connection runs, It utilises the already formed
> informix connection and causes a conflict.

It is not clear to me what you mean by 'the second connection'; it
seems to be something different than an 'Informix connection'.
However, if you have a process 'rmiregistry' that is running the I4GL
library on your behalf, then you need to be sure that you understand
the I4GL and the ESQL/C models for supporting threaded applications.
The I4GL support is simple to explain - there is no support in plain
I4GL for threaded applications. What's more, it would be fairly hard
to add it; there are rather too many global variables lurking around
in the I4GL runtime support library - let alone in the typical piece
of I4GL code - for it to be safe for multi-threaded use.
Consequently, you would need to ensure that the code that invokes I4GL
functions keeps the I4GL library single-threaded - presumably you'd
need to code some sort of mutual exclusion system (a mutex) so that if
one piece of Java is running an I4GL function, all other pieces of
Java are kept out. Even with that mutual exclusion handled, there is
a large probability that two separate Java threads will interfere with
each other. For example, if two Java threads tried to run the same
report at the same time, they would seriously interfere with each
other - you would have to ensure that only one Java thread has a given
report in the 'report started' state (pending FINISH REPORT or
TERMINATE REPORT) at any time; the second thread must either be given
an error (report is busy) or held up until the report is not busy.

You can use multiple connections in I4GL, but the ESQL/C libraries it
uses is not the thread-safe library, so you can only synchronously
switch between the connections. In a thread-safe ESQL/C application
(linked with the thread-safe ESQL/C libraries), you should ensure that
any given connection is used by one thread at a time - and be
extremely careful about which connection each statement was prepared
on, etcetera.

> Has anyone out there managed to get this kind of scenario to work?

No, but neither have I tried. By the resounding silence, I suspect
most other people have not tried either. Consequently, what I said
above is hypothesis, not proven.

--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/

Messages In This Thread

[ View Thread ] [ Post Response ] [ Return to Index ] [ Read Prev Msg ] [ Read Next Msg ]

Development Tools Forum is maintained by Administrator with WebBBS 5.12.