31.07.2013 Views

MySQL Cluster Tutorial - cdn.oreillystatic.com

MySQL Cluster Tutorial - cdn.oreillystatic.com

MySQL Cluster Tutorial - cdn.oreillystatic.com

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

• SessionFactory: There is one instance per <strong>MySQL</strong> <strong>Cluster</strong> instance for each Java<br />

Virtual Machine (JVM). The SessionFactory object is used by the application to get hold<br />

of sessions. The configuration details for the <strong>Cluster</strong>J instance are defined in the<br />

Configuration properties which is an artifact associated with the SessionFactory.<br />

• Session: There is one instance per user (per <strong>Cluster</strong>, per JVM) and represents a <strong>Cluster</strong><br />

connection<br />

• Domain Object: Objects representing the data from a table. The domain objects (and<br />

their relationships to the <strong>Cluster</strong> tables) are defined by annotated interfaces (as shown in<br />

the right-hand side of Figure 2.<br />

Figure 3: <strong>Cluster</strong>J terminology<br />

• Transaction: There is one transaction per session at any point in time. By default, each<br />

query is run under its own transaction.<br />

<strong>Cluster</strong>J will be suitable for many Java developers but it has some restrictions which may<br />

make OpenJPA with the <strong>Cluster</strong>JPA plug-in more appropriate. These <strong>Cluster</strong>J restrictions<br />

are:<br />

• Persistent Interfaces rather than persistent classes. The developer provides the<br />

signatures for the getter/setter methods rather than the properties and no extra methods<br />

can be added.<br />

• No Relationships between properties or between objects can be defined in the domain<br />

objects. Properties are primitive types.<br />

• No Multi-table inheritance; there is a single table per persistent interface<br />

• No joins in queries (all data being queried must be in the same table/interface)<br />

• No Table creation - user needs to create tables and indexes<br />

• No Lazy Loading - entire record is loaded at one time, including large object (LOBs).<br />

Copyright © 2010, Oracle and/or its affiliates. All rights reserved. 51/81

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!