You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Michael Gluckman <mi...@osiristrading.com> on 2004/10/19 10:40:27 UTC

auto-versioning diff between JDBC and File store

Hi 
I am putting a resource under version control using the following code snippet:
Auto-versioning is turned on.

boolean success = res.putMethod(path, content);
if (!success) {
   throw new DocumentException(res.getStatusMessage());
}
success = res.proppatchMethod(path, new PropertyName(NAMESPACE, RESOURCE_ID_PROPERTY_NAME), Integer.toString(newId), true);
if (!success) {
   throw new DocumentException(res.getStatusMessage());
}
success = res.proppatchMethod(path, new PropertyName(NAMESPACE, RESOURCE_TYPE_PROPERTY_NAME), type, true);
if (!success) {
  throw new DocumentException(res.getStatusMessage());
}

success = res.versionControlMethod(path);

When I do this using a file index store, then only 1 version is created (which is what I want). 
If I try this using a JDBC store then I get multiple revisions created for every proppatchMethod. Is this the correct behaviour for
proppachMethod() ?

Regards
Michael

 


Re: auto-versioning diff between JDBC and File store

Posted by Oliver Zeigermann <ol...@zeigermann.de>.
Not quite sure. One thing I can say is properties get versioned as well, 
so it makes sense to create a new revision descriptor for every 
proppatch. I am wondering: aren't properties being versioned in the file 
store??? I thought they were... Or are you talking about content? 
Slightly confused...

Oliver

Michael Gluckman schrieb:

> Hi 
> I am putting a resource under version control using the following code snippet:
> Auto-versioning is turned on.
> 
> boolean success = res.putMethod(path, content);
> if (!success) {
>    throw new DocumentException(res.getStatusMessage());
> }
> success = res.proppatchMethod(path, new PropertyName(NAMESPACE, RESOURCE_ID_PROPERTY_NAME), Integer.toString(newId), true);
> if (!success) {
>    throw new DocumentException(res.getStatusMessage());
> }
> success = res.proppatchMethod(path, new PropertyName(NAMESPACE, RESOURCE_TYPE_PROPERTY_NAME), type, true);
> if (!success) {
>   throw new DocumentException(res.getStatusMessage());
> }
> 
> success = res.versionControlMethod(path);
> 
> When I do this using a file index store, then only 1 version is created (which is what I want). 
> If I try this using a JDBC store then I get multiple revisions created for every proppatchMethod. Is this the correct behaviour for
> proppachMethod() ?
> 
> Regards
> Michael
> 
>  
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: auto-versioning diff between JDBC and File store

Posted by Stefan Lützkendorf <lu...@apache.org>.
with auto-version=checkout-checkin each write method must cause a new 
version (PUT and PROPPATCH requests).

For me it works with the TxFile*Store!
How do you check that only one version is created? I used the 
version-tree report (via DAVExplorer).

If you want only one version after multiple write requests, you may need 
an other value for auto-version (e.g. checkout-unlocked-checkin) or 
manual checkin/checkout.

Stefan



Michael Gluckman wrote:

> Hi 
> I am putting a resource under version control using the following code snippet:
> Auto-versioning is turned on.
> 
> boolean success = res.putMethod(path, content);
> if (!success) {
>    throw new DocumentException(res.getStatusMessage());
> }
> success = res.proppatchMethod(path, new PropertyName(NAMESPACE, RESOURCE_ID_PROPERTY_NAME), Integer.toString(newId), true);
> if (!success) {
>    throw new DocumentException(res.getStatusMessage());
> }
> success = res.proppatchMethod(path, new PropertyName(NAMESPACE, RESOURCE_TYPE_PROPERTY_NAME), type, true);
> if (!success) {
>   throw new DocumentException(res.getStatusMessage());
> }
> 
> success = res.versionControlMethod(path);
> 
> When I do this using a file index store, then only 1 version is created (which is what I want). 
> If I try this using a JDBC store then I get multiple revisions created for every proppatchMethod. Is this the correct behaviour for
> proppachMethod() ?
> 
> Regards
> Michael
> 
>  
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org