SYNERGY-E-NEWS
News and Updates for Synergy/DE Developers

January 6, 2012

 

Synergy/DE 9.5.3 provides enhancements for Unix, OpenVMS, Windows, and .NET Framework

Whether you’re developing solutions for Unix, OpenVMS, Windows, or the .NET Framework, our latest Synergy/DE release has something for you.


Synergy/DE Tech Tip

Limitations on using XCALL COPY on OpenVMS


Platform News

Read a selection of recent articles



Announcing the Q4 Support Survey Winner

Is it you?

 

 

Hooked on Synergy DBMS

Possibilities abound with the new IOHooks class


Quiz

Synergy/DE pros, see if you can answer this question!


Did You Receive Your 2012 Synergex Calendar?

If not, let us know!


Synergex Holiday Reminder

We will be closed on Monday, January 16, in recognition of Martin Luther King Day.

 twitter.com/synergyde

 

Synergy/DE 9.5.3 provides enhancements for Unix, OpenVMS, Windows, and .NET Framework

Whether you’re developing solutions for Unix, OpenVMS, Windows, or the .NET Framework, our latest Synergy/DE release has something for you.

Are you using Synergy DBMS files? New I/O statement hooks let you add logic to be performed when any operation on your Synergy DBMS files is executed. Are you accessing your applications from Java clients? Check out the new support for coerced types and passing enumerations. Do you have a UI Toolkit interface? The improved bounds checking will help you find errors in your code, and a new U_EDIT routine enables you to edit text and control line breaks. Are you developing Synergy .NET solutions? 9.5.3 has significant .NET enhancements, including better compiler and runtime performance, support for generics and Lambda functions, numerous improvements to Synergy Language Integration for Visual Studio, and much more.

Visit the Synergy/DE Web site for more information and to download.




Hooked on Synergy DBMS

Possibilities abound with the new IOHooks class
By John Brunett, Sr. System Software Engineer, Synergy/DE

A new Synergy feature available with the recent 9.5.3 release is called I/O Statement Hooks. If you’ve read Richard Morris’ blog on the Synergex website, you may be familiar with it. Richard, being the biggest advocate of this feature, was instrumental in its design.

The IOHooks class can be used for many different purposes. As Richard puts it, the possibilities are endless. You can use it to replicate your Synergy data to a relational database, record transactions to a log file, encrypt and decrypt your data, or even log I/O when you want to debug your application. All of these and more can be done transparently, without changing a single line of code in your existing I/O routines.

To begin with, IOHooks was developed entirely as a SynergyDE class. Using it takes some OO experience, but developers without OO experience can easily take the template IOHooks class at the end of this article and extend it to do whatever they want. The IOHooks base class in the distribution contains a set of 17 virtual hook methods (9 pre-operation and 8 post-operation) and 4 constructors. To make use of IOHooks, all you have to do is create your own class that extends the IOHooks class, implements one or more constructors, and overrides one or more hook methods.

Then, in your application, you create an instance of your class, passing along the channel on which the file is open. That’s it! Now, any I/O operation that you’ve hooked (FIND, READ, READS, STORE, WRITE, WRITES, DELETE, UNLOCK, CLOSE) will first call and execute your pre-operation hook method (if you have one). Immediately after your method exits, the I/O operation is issued. Then, following the I/O, your post-operation hook method (if you have one) is called and executed. And once your post-operation hook exits, your application resumes.

What you do inside your pre- and post-operation hook methods is what adds the substance to this feature. In pre-operation WRITES, your hook method will have access to the record buffer before it’s written. In post-operation READS, your hook method will have access to the record buffer after it’s been read and before your application gets it. Add some encryption logic to your pre-hook code and decryption logic to your post-hook code, and you’ve now seamlessly employed encryption in your file. Add logic to your post-write methods to log updates to a file. Add a debugging option that dynamically enables a debug IOHook class to keep track of record locks. As you can see, the possibilities go on and on.

But to truly understand how easy using IOHooks is, you need to see some sample code. Here’s a simple code example of an IOHooks class that reads through the Synergy message file, syntxt.ism. I’ve hooked the post-operation READS statement and, just for fun, added logic to suppress the error mnemonic by replacing it with dots.

import Synergex.SynergyDE.Select
import Synergex.SynergyDE.IOExtensions

namespace myns
    class myhooks extends IOHooks

        public method myhooks
            in channel,          n
            parent(channel)
        proc
        endmethod

        public override method reads_post_operation_hook, void
            inout buffer,        a
            in optional out_rfa, a
            in flags,            IOFlags
            inout error,         int
        proc
            buffer(9:10) = " ........ "    ;Replace mnemonic
        endmethod

endclass
endnamespace

main
    record
        rec,     a218
    proc
        open(15, o, 'tt:')
        open(1, u:i, "DBLDIR:syntxt")
        (void)new  myhooks(1)               ;Hook channel 1
        repeat
          begin
            reads(1, rec, eof)
            writes(15, %atrim(rec))
          end
    eof,
        close 1
        stop

The main application logic in this example just sees the record as the hook method presents it ¬ it’s none the wiser. Also, the myhooks class is just a snippet of the overall IOHooks template provided below. All I’ve done is add a single line to the READS method; the rest of the class template can be used as is.

The above example shows what you can do with one I/O statement and one direction. You might want to develop a class that hooks each I/O operation and both directions and then enable and disable them dynamically. You can even hook a Select class and intercept records as they’re retrieved. The possibilities are truly endless.

As you can see, I/O Statement Hooks can be a useful tool. Just remember, once your methods are hooked to a channel, they’ll be executed on every matching I/O. You don’t want excessive logic to bog down your application, so keep your hook methods simple and efficient.

Here is the IOHooks template that’s discussed above:

import Synergex.SynergyDE.Select
import Synergex.SynergyDE.IOExtensions

namespace hooks
    class hooks_template extends IOHooks

        public method hooks_template
            in channel,   n
            in premask,   IOEventMask
            in postmask,  IOEventMask
            parent(channel, premask, postmask)
        proc
        endmethod

        public method hooks_template
            in channel,   n
            parent(channel)
        proc
        endmethod

        public method hooks_template
            in from,      @From
            parent(from)
        proc
        endmethod

        method ~hooks_template
        proc
        endmethod

        public override method find_pre_operation_hook, void
            mismatch in optional key, n
            in optional in_rfa,       a
            in optional keynum,       n
            in flags,                 IOFlags
        proc
        endmethod

        public override method read_pre_operation_hook, void
            mismatch in optional key, n
            in optional in_rfa,       a
            in optional keynum,       n
            in flags,                 IOFlags
        proc
        endmethod

        public override method reads_pre_operation_hook, void
            in flags,           IOFlags
        proc
        endmethod

        public override method write_pre_operation_hook, void
            inout buffer,        a
            in optional recnum,  n
            in optional out_rfa, a
            in flags,            IOFlags
        proc
        endmethod

        public override method writes_pre_operation_hook, void
            inout buffer,        a
            in flags,            IOFlags
        proc
        endmethod

        public override method store_pre_operation_hook, void
            inout buffer,        a
            in flags,            IOFlags
        proc
        endmethod

        public override method delete_pre_operation_hook, void
        proc
        endmethod

        public override method unlock_pre_operation_hook, void
            in optional rfa,     a
            in flags,            IOFlags
        proc
        endmethod

        public override method close_pre_operation_hook, void
            in flags,            IOFlags
        proc
        endmethod

        public override method find_post_operation_hook, void
            mismatch in optional key, n
            in optional out_rfa,      a
            in optional keynum,       n
            in flags,                 IOFlags
            inout error,              int
        proc
        endmethod

        public override method read_post_operation_hook, void
            inout buffer,             a
            mismatch in optional key, n
            in optional out_rfa,      a
            in optional keynum,       n
            in flags,                 IOFlags
            inout error,              int
        proc
        endmethod

        public override method reads_post_operation_hook, void
            inout buffer,             a
            in optional out_rfa,      a
            in flags,                 IOFlags
            inout error,              int
        proc
        endmethod

        public override method write_post_operation_hook, void
            inout buffer,        a
            in optional recnum,  n
            in optional out_rfa, a
            in flags,            IOFlags
            inout error,         int
        proc
        endmethod

        public override method writes_post_operation_hook, void
            inout buffer,        a
            in optional out_rfa, a
            in flags,            IOFlags
            inout error,         int
        proc
        endmethod

        public override method store_post_operation_hook, void
            inout buffer,           a
            in optional stored_rfa, a
            in flags,               IOFlags
            inout error,            int
        proc
        endmethod

        public override method delete_post_operation_hook, void
            inout error,   int
        proc
        endmethod

        public override method unlock_post_operation_hook, void
            in flags,      IOFlags
            inout error,   int
        proc
        endmethod

    endclass
endnamespace

For more information about the IOHooks class, see Synergex.SynergyDE.IOExtensions.IOHooks in chapter 9 of the Synergy Language Reference Manual.


Synergy/DE Tech Tip

Limitations on using XCALL COPY on OpenVMS

Question
I am trying to make a copy of an existing RMS file on OpenVMS using the COPY subroutine and Synergy/DE xfServer, but when I then try to access the RMS file, I get an error message about an invalid record size and a corrupted file. The binary flag has been set, and the original, as well as the new files, are both on the OpenVMS machine. What is happening?

Answer
In most cases, when using XCALL COPY via xfServer on an OpenVMS system, the file attributes are not preserved; the attributes are preserved only when the COPY routine is called locally on the system. As a workaround, you can use the OPEN statement with the pipe option, which will run the command locally.
Note: Because of the inability to preserve the OpenVMS file attributes, in a coming release the transfer of ISAM files to or from OpenVMS using xfServer will not be allowed and will generate an error.

 




Quiz

Synergy/DE pros, see if you can answer this question!

If we have a field named "balance" that is declared as a d28, what is the most accurate way of multiplying its value by 95% and storing the result back into the same field?

a. balance = balance * 0.95
b. balance = (balance * 95) / 100
c. balance = (balance * 95)#2
d. balance = (double)balance * 0.95


Platform News

OpenVMS
Java for OpenVMS patch release 1.6.0-3.p1
http://www.openvms.org/stories.php?story=11/12/14/5543074

Got questions about HP Project Odyssey - Single Platform Mission Critical Computing?
http://h30507.www3.hp.com/t5/Mission-Critical-Computing-Blog/Got-Questions-About-HP-Project-Odyssey-Single-Platform-Mission/ba-p/103473

Windows

Users desert Windows XP in near-record numbers
http://www.computerworld.com/s/article/9223094/Users_desert_Windows_XP_in_near_record_numbers?taxonomyId=89

Data corruption occurs when a user updates a shared file on a computer that is running Windows Vista or Windows Server 2008
http://support.microsoft.com/kb/2635024

Microsoft gets silent upgrade religion, will push IE auto-updates
http://www.computerworld.com/s/article/9222690/Microsoft_gets_silent_upgrade_religion_will_push_IE_auto_updates?source=toc

Other

Amazon takes supercomputing to the cloud
http://news.cnet.com/8301-1001_3-57349321-92/amazon-takes-supercomputing-to-the-cloud/?tag=mncol;txt


Did You Receive Your 2012 Synergex Calendar?

If not, let us know!

Designed by local Sacramento artist Daniel Tirapelli, this year’s calendar has the theme of “no boundaries,” illustrating the concept that there are no limits to where you can take your software applications with today’s Synergy/DE.
2012 Calendar
If you did not receive your Synergex 2012 calendar, or would like additional complimentary copies, please e-mail us at synergy@synergex.com. Include your address and the quantity you’d like, and we’ll send them your way.


Announcing the Q4 Support Survey Winner

Is it you?

If you’re Terry Jones from Turnkey Computer Systems, it is! Terry is the winner of the Q4 Developer Support Survey contest and the recipient of a $100 American Express gift card!

Turnkey Computer Systems is the premier provider of accounting and management solutions to the feedyard industry. Their Synergy/DE-based software has been on the leading edge of the cattle feeding industry for over 25 years, currently tracking over 10 million head of cattle per year in 18 states and Canada.

Want a chance to win? Let us know what you think! Fill out a survey next time you work with Developer Support on an issue. We use these surveys to monitor customer satisfaction, and each quarter we choose a winner by randomly selecting the name of a customer who has completed a survey after working with Developer Support. So, next time you call on us for support, let us know how we did, and you could win $100 just for giving us your feedback.
Thanks to everyone who completed a Developer Support survey in Q4, and we look forward to hearing from you again.
If you do not currently have Synergy/DE Developer Support, contact your Synergy/DE account manager for more information.


Synergex Holiday Reminder

We will be closed on Monday, January 16, in recognition of Martin Luther King Day.

If you anticipate needing our assistance on this day, please e-mail us at synergy@synergex.com to make arrangements.