Join IIUG
 for   
 

Informix News
18 Nov 13 - ZDNet - Top 20 mobile skills in demand... Read
09 Sep 13 - telecompaper - Shaspa and Tatung have shown a new smart home platform at Ifa in Berlin. Powered by the IBM Informix software... Read
06 Sep 13 - IBM data magazine - Mission Accomplished - Miami, Florida will be the backdrop for the 2014 IIUG Informix Conference... Read
01 Feb 13 - IBM Data Magazine - Are your database backups safe? Lester Knutsen (IBM Champion) writes about database back up safety using "archecker"... Read
14 Nov 12 - IBM - IBM's Big Data For Smart Grid Goes Live In Texas... Read
3 Oct 12 - The Financial - IBM and TransWorks Collaborate to Help Louisiana-Pacific Corporation Achieve Supply Chain Efficiency... Read
28 Aug 12 - techCLOUD9 - Splunk kicks up a SaaS Storm... Read
10 Aug 12 - businessCLOUD9 - Is this the other half of Cloud monitoring?... Read
3 Aug 12 - IBM data management - Supercharging the data warehouse while keeping costs down IBM Informix Warehouse Accelerator (IWA) delivers superior performance for in-memory analytics processing... Read
2 Aug 12 - channelbiz - Oninit Group launches Pay Per Pulse cloud-based service... Read
28 May 12 - Bloor - David Norfolk on the recent Informix benchmark "pretty impressive results"... Read
23 May 12 - DBTA - Informix Genero: A Way to Modernize Informix 4GL Applications... Read
9 Apr 12 - Mastering Data Management - Upping the Informix Ante: Advanced Data Tools... Read
22 Mar 12 - developerWorks - Optimizing Informix database access... Read
14 Mar 12 - BernieSpang.com - International Informix User Group set to meet in San Diego... Read
1 Mar 12 - IBM Data Management - IIUG Heads West for 2012 - Get ready for sun and sand in San Diego... Read
1 Mar 12 - IBM Data Management - Running Informix on Solid-State Drives.Speed Up Database Access... Read
26 Feb 12 - BernieSpan.com - Better results, lower cost for a broad set of new IBM clients and partners... Read
24 Feb 12 - developerWorks - Informix Warehouse Accelerator: Continuous Acceleration during Data Refresh... Read
6 Feb 12 - PRLOG - Informix port delivers unlimited database scalability for popular SaaS application ... Read
2 Feb 12 - developerWorks - Loading data with the IBM Informix TimeSeries Plug-in for Data Studio... Read
1 Feb 12 - developerWorks - 100 Tech Tips, #47: Log-in to Fix Central... Read
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 ]

IDS Forum

Re: locking error (problem)

Posted By: Art S. Kagel (Oninit LLC)
Date: Wednesday, 6 February 2008, at 10:44 a.m.

In Response To: Re: locking error (problem) (DANNY DE KOSTER)

DANNY DE KOSTER wrote:
> Art,
>
> First of all thanks for your comment....off course all the others also manny
> thanks.
>
> What I have done now.....
>
> I do first of all an insert....chech on status....eventually do an update.
> Then the first and second user can work normally.
> But a bit later in my program I did an update again...there is still fails.
>
> I now I need to minimize a transaction but in this case the user needs to
> control an invoice with changes of their price, etc..... So it can take a time
> before they finish there job because at the same time they need to pick up the
> phone and help there customers, etc...
> They needed the possibility at the end of the control not to accept there
> modifications. So I thought to use rollback work to not accept there
> modifications.
>
> Any other ideas? Or working with tempory tables.
>

No. You need to modify your applications to use what's known as an
optimistic locking protocol. I've posted something like this once or
thrice before, but here are the steps:

1- fetch the data, if it exists, without locking (so no FOR UPDATE
clause in the SELECT).
2- present the fetched data or a blank new record to the user for
modification IN MEMORY to a copy of the original record ONLY - it's
critical to keep an unmodified copy of the data.
3- ONLY after all data entry or modifications to all parent and child
records have been made, then refetch the record using the keys on screen
- so if it's a new record you just pretend it already existed but was
all blank - into a separate memory structure. This fetch is made inside
a transaction with a lock - so it should include a FOR UPDATE clause.
4- Compare the refetched data to the original unmodified data, and if
there have been no changes by another user - that's the optimism part -
you optimistically assume that only one user will be working on any
record at a time - then you update or insert the row or rows and COMMIT
WORK immediately. Rows are only locked momentarily and transactions are
never delayed while the user answers the phone, goes to the rest room,
or out to lunch. If the records do not match, then you ROLLBACK the
transaction freeing the locks even faster and tell the user that someone
else has modified the record he/she was trying to work on.

Now, to simplify all this and ease both the memory needed to handle the
three copies of the data and the time spend verifying that there hasn't
been an interfering update, you can use a timestamp column in each
table, or at least in the parent table, (defined as YEAR TO FRACTION(3)
and with USEOSTIME turned on in the ONCONFIG file) that is always
updated when the record (or one of its children) is modified. This can
be done with a DEFAULT CURRENT YEAR TO FRACTION(3) option on the column
so that the column is auto-populated at INSERT time and by an UPDATE
TRIGGER on the table and/or any of it's children that will update the
timestamp column in the row (or the parent row) when one of those
records is modified. Then you ONLY have to compare the original
timestamp to the one you refetch just before attempting the updates.
This is guaranteed to work EVEN if users modify the rows outside of your
application since the timestamps are being maintained by the engine.

Optimistic locking works because in the real world of business, it is
rare for more than one user to modify the same records at the same
time. It might happen if say two contacts at a customer site contacted
your company at the same instant both wanting to modify the same order
at the same moment, so the software handles it, but it is safe to assume
that this will be rare enough to not interfere with the normal daily
work flow.

Art S. Kagel
> Danny
>

===========================================================================================
Please access the attached hyperlink for an important electronic communications disclaimer:

http://www.oninit.com/home/disclaimer.php

===========================================================================================

Messages In This Thread

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

IDS Forum is maintained by Administrator with WebBBS 5.12.