Save 
Join IIUG
 for   
 

Informix News
13 Jan 12 - MC Press online - Informix Dynamic Server Entices New Users with Free Production Edition ... Read
11 Jan 12 - Computerworld - Ecologic Analytics and Landis+Gyr -- Suitors Decide to Tie the Knot... Read
9 Jan 12 - planetIDS.com - DNS impact on Informix / Impacto do DNS no Informix... Read
8 Sep 11 - TMCnet.com - IBM Offers Database Solution to Enable Smart Meter Data Capture... Read
1 Aug 11 - IBM Data Management Magazine - IIUG user view: Happy 10th anniversary to IBM and Informix... Read
8 Jul 11 - Database Trends and Applications - Managing Time Series Data with Informix... Read
31 May 11 - Smart Grid - The meter data management pitfall utilities are overlooking... Read
27 May 11 - IBM Data Management Magazine - IIUG user view: Big data, big time ( Series data, warehouse acceleration, and 4GLs )... Read
16 May 11 - Business Wire - HiT Software Announces DBMoto for Enterprise Integration, Adds Informix. Log-based Change Data Capture... Read
21 Mar 11 - Yahoo! Finance - IBM and Cable&Wireless Worldwide Announce UK Smart Energy Cloud... Read
14 Mar 11 - MarketWatch - Fuzzy Logix and IBM Unveil In-Database Analytics for IBM Informix... Read
11 Mar 11 - InvestorPlace - It's Time to Give IBM Props: How many tech stocks are up 53% since the dot-com boom?... Read
9 Mar 11 - DBTA - Database Administration and the Goal of Diminishing Downtime... Read
2 Feb 11 - DBTAs - Informix 11.7 Flexible Grid Provides a Different Way of Looking at Database Servers... Read
27 Jan 11 - exactsolutions - Exact to Add Informix Support to Database Replay, SQL Monitoring Solutions... Read
25 Jan 11 - PR Newswire - Bank of China in the UK Works With IBM to Become a Smarter, Greener Bank... Read
12 Oct 10 - Database Trends and Applications - Informix 11.7: The Beginning of the Next Decade of IBM Informix... Read
20 Sep 10 - planetIDS.com - ITG analyst paper: Cost/Benefit case for IBM Informix as compared to Microsoft SQL Server... Read
20 Jul 10 - IBM Announcements - IBM Informix Choice Edition V11.50 helps deploy low-cost scalable and reliable solutions for Apple Macintosh and Microsoft Windows... Read
20 Jul 10 - IBM Announcements - Software withdrawal: Elite Support for Informix Ultimate-C Edition... Read
24 May 10 - eWeek Europe - IBM Supplies Database Tech For EU Smart Grid... Read
23 May 10 - SiliconIndia - IBM's smart metering system allows wise use of energy... Read
21 May 10 - CNET - IBM to help people monitor energy use... Read
20 May 10 - ebiz - IBM Teams With Hildebrand To Bring Smart Metering To Homes Across Britain... Read
19 May 10 - The New Blog Times - Misurare il consumo energetico: DEHEMS è pronto... Read
19 May 10 - ZDNet - IBM software in your home? Pact enables five-city smart meter pilot in Europe... Read
17 March 10 - ZDNet (blog) David Morgenstern - TCO: New research finds Macs in the enterprise easier, cheaper to manage than... Read
17 March 2010 - Virtualization Review - ...key components of Big Blue's platform to the commercial cloud such as its WebSphere suite of application ser vers and its DB2 and Informix databases... Read
10 February 2010 - The Wall Street Journal - International Business Machines is expanding an initiative to win over students and professors on its products. How do they lure the college crowd?... Read


End of Support Dates

IIUG on Facebook IIUG on Twitter


[ 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: Rivka Shisman
Date: Tuesday, 21 March 2006, at 4:24 a.m.

In Response To: Re: Java with informix 4gl shared objects (sergio@moredata.pt)

Hi Sergio

Can you please attach the Adapter and generator code?
It can be very helpful to us :-)

Thanks a lot
Rivka

-----Original Message-----
From: development-tools-bounces@iiug.org [mailto:development-tools-bounces@iiug.org] On Behalf Of sergio@more....
Sent: Monday, March 20, 2006 11:43 AM
To: development-tools@iiug.org
Subject: Re: Java with informix 4gl shared objects [71]

Hi

I have a project where I need to call 4gl from a Java Application Server
(Websphere).

I have passed by all the problems that Jonathan is speaking about.
I finished by develop a Java 2 EE Resource Adapter (J2EE Connector
Architecure) and a generator that parses the 4gl code and generates all
the necessary stubs.

This way all the 4gl code (without user interface) is exposed to a J2EE
stack in a matter of seconds.

It fixes the problems of multi threading and the problem of having JNI
linked in the application server that could be a huge problem in a
enterprise class aplication.

Sérgio

> 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/
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>

*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.

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.