All Examples  All EJB Examples

Package Index

Enterprise JavaBean sequence example
packages and classes

about this example

This example consists of two packages that demonstrate creating unique identication numbers using Enterprise JavaBeans. These techniques could be used when creating entity beans, which require a unique primary key.

Please run these examples before attempting to create your own Enterprise JavaBeans, as it will show you the different steps involved.

Package examples.ejb.sequence.jdbc

The jdbc example demonstrates: Note that this application of sequence scales by caching a range of unique IDs as class attributes of the bean. The bean only goes to the database for an ID when the range is exhausted.

Performance could be further improved by using a stored procedure on the database to generate the primary key instead of the procedure contained in the EJBean.

Package examples.ejb.sequence.oracle

The oracle example demonstrates: Note that this application of sequence scales by caching a range of unique IDs as class attributes of the bean. The bean only goes to the database for an ID when the range is exhausted.

Performance could be further improved by using a stored procedure on the database to generate the primary key instead of the procedure contained in the EJBean.

how to use this example

See the individual examples (jdbc and oracle) for instructions on building and running each example.

there's more

Read more about EJB in the Developers Guide, Using WebLogic Enterprise JavaBeans.

Copyright © 1997-1999 BEA Systems, Inc. All rights reserved.

Last updated 07/23/1999