Database partioning and JadeBytes

For questions and postings not covered by the other forums
MJones
Posts: 10
Joined: Fri Jan 28, 2011 12:07 pm

Database partioning and JadeBytes

Postby MJones » Wed Aug 24, 2011 4:03 pm

When using a JadeBytes persistent instance is there any way to get map file partioning working? Jade continues to operate using the original _udr map file which does not partition when the parent instance (into which the JadeByte is embedded) dbfile is partioned. I do imagine this is likely intended behaviour given that a JadeByte is actually a collection class and partioning does not support collections, but in practical terms a JadeByte is used in quite different ways to a standard JADE collection and so if partioning were available it could be highly useful.

I would prefer to implement my solution using JadeBytes for the caching benefits and in my situation a 'single' map file (_udr) is the only viable option as I am dealing with 2-3 million binary instances. Luckily partioning is not a deal breaker in itself but would certainly be nice to have.

Regards,
Michael Jones

cnwjd
Posts: 6
Joined: Tue Nov 10, 2009 4:00 pm

Re: Database partioning and JadeBytes

Postby cnwjd » Fri Aug 26, 2011 10:29 am

Hi Michael,

As you have realised, you cannot partition a 'stand alone' Collection Class and that includes JadeBytes. You can however, partition a class that has exclusive collection properties and that includes properties of type JadeBytes. To add an exclusive JadeBytes property to a class use the IDE Properties->Add Attribute menu item -- this is similar to adding an exclusive primitive array (conceptually a JadeBytes object is an ordered collection of Byte).

Example: If you have Class C1, mapped to file m1 and C1 has one or more exclusive properties of type JadeBytes (or a subclass). As long as C1 is the only class mapped to C1, m1 can be partitioned. When you instantiate instances of C1 and store data in the JadeBytes properties you will end up with a set of database files like this.

m1.dat -- the partition control file
m1_ndx.dat -- the global partition index
m1_part0000000001.dat -- the first partition
m1_part0000000001_udr.dat -- the first partition's UDR file -- contains JadeBytes instances associated with objects stored in partition 1

The will be a partition file of the from m1_part<nnnnnnnnnn>.dat for each partition you create; a m1_part<nnnnnnnnnn>_udr.dat is instantiated when the first JadeBytes instance for the partition is created.

If you were to use the Object::moveToPartition method to move an instance of C1 from one partition to another, then all of its subobjects are moved with it; subobjects include: exclusive collection, jadeBytes and blob/slob properties.
Just Another Developer

MJones
Posts: 10
Joined: Fri Jan 28, 2011 12:07 pm

Re: Database partioning and JadeBytes

Postby MJones » Tue Aug 30, 2011 3:03 pm

Superb thank you very much. I appreciate you taking the time to reply.

Regards,
Michael.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 24 guests