EJBUtils How To

by

Version: 1.2beta
$Id: $


Table of Contents


Introduction

This "How To" is a complement to the manual. It explains how to do a few things that have been requested in the past by users of EJBUtils.


Allow EJBUtils to work with databases not supporting "FOR UPDATE"

This will allow to use EJBUtils for test purposes with a larger number of databases but be aware that THE UID GENERATOR WOULD BE UNFIT FOR PRODUCTION as it will not guaranty that the HIGH value obtained through the database call is unique.

Here is what you have to do: in the UIDHighKeyGeneratorBean class java file, comment the "FOR UPDATE" part of the string as following:

public class UIDHighKeyGeneratorBean implements SessionBean {

    [...]

    public Key getNextHighKey(Key theHighKey, String theName) throws RemoteException,
    FinderException {

        [...]

        String selectForUpdateQueryString =
            "SELECT "+ theHighKeyColumn +" FROM "+ theTable+" WHERE "+ theNameColumn +" = ?";// FOR UPDATE";

        [...]

    }

    [...]

}

Copyright © 2000-2001 E.H.S. Technologies (Europe) Ltd. All rights Reserved.