Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question

beginners example of CRUD operations


I am new to XAP and would like to know if there is any example application / tutorial that demonstrate the use of XAP for a generic information system including all CRUD operations on hierarchical domain model (including issues like lazy load, transactions etc). Also - Hibernate integration (or any other mechanism) that sync data from the space to the database in ansyc matter (including bootstrapping of the space etc).

The basic hello world is a nice starter but frankly - it can't get you anywhere. In order to consider the use of XAP as a core product (and not just 2nd level cache) we need an end to end tutorial that demonstrate the entire flow. The car wash example is not even close to being a practical example.

thanks, CB.

Edited by: C B on Feb 1, 2009 4:44 PM

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2835]{quote}

asked 2009-02-01 00:53:03 -0500

chenb gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

There are plenty of examples – see:
http://www.openspaces.org/display/DAE/OpenSpacesDemosandExamples – See the pet clinic – this got async persistency , hierarchical domain , and executors used.
http://www.gigaspaces.com/wiki/display/XAP66/XAPOrderManagementTutorial – This is using transactions and many other features
http://www.gigaspaces.com/wiki/display/XAP66/DataExample – This is using plenty of product features

For skeleton application using async persistency see the basic-async-persistency maven template:


answered 2009-02-01 21:13:38 -0500

shay hassidim gravatar image
edit flag offensive delete link more


Thanks Shay, I will look into those examples. I managed to find the Pet Clinic prior to your post - but it required digging the forums...

The Pet Clinic contains an eclipse project but when trying to import it is not an easy process. I know that I have some missing User Libraries - can you elaborate on how to add those? The only remarks I found on the project home page are:

"You need to have the following path variables in either IDE for you're project to compile correctly within it: GS_HOME - points to GigaSpacesXAP home, SPRING25_HOME - points to the Spring framework 2.5.4 (or higher) distribution, MYSQL_DRIVER_JAR - points to the MySql driver jar. Note that in Eclipse you will have to define the user libraries"

But this is not enough - can you please provide detailed instruction on how to import configure and build the project in eclipse?

chenb gravatar imagechenb ( 2009-02-02 01:51:30 -0500 )edit


I'm trying to compile the Pet Clinic - I have created the user libs for spring and gigaspaces and now I get less errors - can you help me to resolve them:

project webapp errors:

The import org.springframework.web.bind cannot be resolved

for the following annotation types the attributes's value is undefined: SessionAttibutes RequestParam RequestMapping ModelAttribute

project common errors:

The following types cannot be converted to Annotations:

SpaceRouting SpaceId SpaceExclude

chenb gravatar imagechenb ( 2009-02-02 08:07:29 -0500 )edit

I managed to get rid of most of the compilation errors (forgot to add <spring-home>/dist to the user lib )

now it's down to the annotations errors -

the compiler cannot convert the Gigaspaces annotations to the base Annotation class -

I get errors like "cannot convert from TaskGigaSpaces to Annotation"

I noticed that those Gigaspace classes are defined in JSpaces.jar located in the <xap-home>/lib directory and it is included in the user lib of my eclipse project. so what's the problem?

Maybe I'm using the wrong version of XAP for the PetClinic example?

Here is the manifest file from that jar:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.5
Created-By: 1.5.0_13-b05 (Sun Microsystems Inc.)
Main-Class: com.j_spaces.core.client.SpaceFinder
Build: 3100
Version: 6.6.2-XAPPremium-ga
Built-By: tgrid On 20081127_1430
Implementation-Vendor: GigaSpaces Technologies
Obfuscated: false
Compatible: 1.4
Class-Path: .. jini/jsk-platform.jar jini/jsk-lib.jar jini/start.jar j
 ini/reggie.jar jini/mahalo.jar ServiceGrid/gs-lib.jar common/backport
 -util-concurrent.jar jmx/jmxremote.jar jmx/jmxri.jar jmx/jmxtools.jar
ServiceGrid/gs-boot.jar jdbc/h2.jar

chenb gravatar imagechenb ( 2009-02-11 15:51:11 -0500 )edit

U are using GigaSpapaces XAP for JDK 1.4. You need to use GigaSpaces XAP for JDK 1.5 / 1.6.


shay hassidim gravatar imageshay hassidim ( 2009-02-11 16:26:06 -0500 )edit

thanks, that did the work! it will be nice if you add a note in the pet clinic project home page that the XAP for 1.5 is required and that the 1.4 version will not compile.

thanks for all the help!

chenb gravatar imagechenb ( 2009-02-12 05:32:10 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2009-02-01 00:53:03 -0500

Seen: 114 times

Last updated: Feb 01 '09