I did with contacts, not contractors (it failed before reaching the
contractors). So here is the intializeContact method. You can replace the
DataGenHelper random creation methods by static data.
private void initializeContact(Node contact)
throws RepositoryException {
final Calendar cal = Calendar.getInstance();
contact.setProperty("jcr:lastModified", cal);
final String firstName =
DataGenHelper.createRandomData("firstNames");
contact.setProperty("lgw:fistName", firstName);
final String lastName =
DataGenHelper.createRandomData("lastNames");
contact.setProperty("lgw:lastName", lastName);
final String companyMail =
DataGenHelper.createRandomData("company_names").toLowerCase();
companyMail.replace(' ', '.');
contact.setProperty("lgw:email", firstName.toLowerCase() + "."
+ lastName.toLowerCase() + "@" + companyMail +
".com");
contact.setProperty("lgw:function",
DataGenHelper.createRandomData("jobFunctions"));
contact.setProperty("lgw:phoneNumber",
DataGenHelper.createPhoneNumer());
Node address = contact.addNode("lgw:address");
initializeAddress(address);
}
private void initializeAddress(Node address)
throws RepositoryException {
final Date date = new Date();
address.setProperty("lgw:street", DataGenHelper
.createRandomData("streets"));
address.setProperty("lgw:zipCode",
DataGenHelper.createZipCode());
address.setProperty("lgw:state", DataGenHelper
.createRandomData("states_provinces"));
address.setProperty("lgw:country", DataGenHelper
.createRandomData("countries"));
}
And the CNDs :
<'lgw'='http://www.legisway.com'>
<'nt'='http://www.jcp.org/jcr/nt/1.0'>
<'mix'='http://www.jcp.org/jcr/mix/1.0'>
<'jcr'='http://www.jcp.org/jcr/1.0'>
[lgw:contactType] > nt:base, mix:referenceable
- jcr:lastModified (date) mandatory ignore
- lgw:fistName (string) mandatory
- lgw:lastName (string) primary mandatory
- lgw:email (string) mandatory
- lgw:function (string)
- lgw:phoneNumber (string)
+ lgw:address (lgw:addressType) = lgw:addressType
<'lgw'='http://www.legisway.com'>
<'nt'='http://www.jcp.org/jcr/nt/1.0'>
<'mix'='http://www.jcp.org/jcr/mix/1.0'>
<'jcr'='http://www.jcp.org/jcr/1.0'>
[lgw:contactsType]
+ lgw:contact (lgw:contactType) = lgw:contactType multiple
<'lgw'='http://www.legisway.com'>
<'nt'='http://www.jcp.org/jcr/nt/1.0'>
<'mix'='http://www.jcp.org/jcr/mix/1.0'>
<'jcr'='http://www.jcp.org/jcr/1.0'>
[lgw:addressType]
- lgw:street (string) mandatory
- lgw:zipCode (string) mandatory
- lgw:state (string)
- lgw:country (string) mandatory
And the business root node type :
<'lgw'='http://www.legisway.com'>
<'nt'='http://www.jcp.org/jcr/nt/1.0'>
<'mix'='http://www.jcp.org/jcr/mix/1.0'>
[lgw:rootType] > nt:base, mix:referenceable
+ lgw:contacts (lgw:contactsType) = lgw:contactsType
+ lgw:contracts (lgw:contractsType) = lgw:contractsType
+ lgw:contractors (lgw:contractorsType) = lgw:contractorsType
As you can see, the tree structure gives this :
/
|-lgw:root
|-lgw:contacts
|-lgw:contact
|-lgw:contact
...
You can replace contractor(s) by contact(s) in the code
Frédéric Esnault - Ingénieur R&D
-----Message d'origine-----
De : Thomas Mueller [mailto:[EMAIL PROTECTED]
Envoyé : mercredi 20 juin 2007 11:22
À : [email protected]
Objet : Re: atomic vs group node creation/storage
Hi,
I am trying to reproduce the problem (with 1000 child nodes), but so
far I couldn't find a problem. This could have two reasons:
A) Are you sure you cleaned the repository between tests?
B) The method initializeContractor.
Could you please send your code for initializeContractor?
I used:
static void initializeContractor(Session session, Node contractor)
throws Exception {
contractor.setProperty("name", "Hello");
}
After testOneByOne I have:
SELECT COUNT(*) FROM default_binval: 0
SELECT COUNT(*) FROM default_node: 1003
SELECT COUNT(*) FROM default_prop: 2003
SELECT COUNT(*) FROM default_refs: 0
SELECT COUNT(*) FROM version_binval: 0
SELECT COUNT(*) FROM version_node: 1
SELECT COUNT(*) FROM version_prop: 1
SELECT COUNT(*) FROM version_refs: 0
After testBatch I have:
SELECT COUNT(*) FROM default_binval: 0
SELECT COUNT(*) FROM default_node: 1003
SELECT COUNT(*) FROM default_prop: 2003
SELECT COUNT(*) FROM default_refs: 0
SELECT COUNT(*) FROM version_binval: 0
SELECT COUNT(*) FROM version_node: 1
SELECT COUNT(*) FROM version_prop: 1
SELECT COUNT(*) FROM version_refs: 0
So, no difference.
Thanks,
Thomas
On 6/20/07, Jukka Zitting <[EMAIL PROTECTED]> wrote:
> Hi,
>
> On 6/20/07, Felix Meschberger <[EMAIL PROTECTED]> wrote:
> > This seems more related to how the MySQL persistence manager handles
> > constant updates of a shared parent nodes with more and more child nodes.
> > Also your use of same name sibblings might be an issue, actually.
>
> This sounds like it could be a problem in how same name siblings are
> handled in NodeState. If this is the case and someone can further
> qualify the issue and fix it in a short timeframe, I would very much
> like to have the fix included in 1.3.1.
>
> BR,
>
> Jukka Zitting
>