Hi Zoltan,
I could not find any obvious bug in your code. The transaction feature is new in 2.1, so maybe there still are bugs in it. The only thing that might help is to debug the server and see at what point the propfind blocks. Asking again, what kind of store are use using?
Oliver
L Z schrieb:
Hello Oliver,
thank you for your answer.
Here is the code snippet (sorry for the linebreaks but this is the best what i can get with yahoo).
try
{
String parentPath =
PathUtils.getParentUrl(rootPath);
manager.currentResource.setPath(URIUtil.getPath(parentPath));
executed =
manager.currentResource.startTransaction(manager.currentResource.getHttpURL().getUser(),
600);
executed = executed ?
manager.currentResource.mkcolMethod(rootPath): false;
executed = executed ?
manager.currentResource.proppatchMethod(rootPath, new
PropertyName("DAV:" , EXWebdavResource.TYPE),
ItemTypes.getStringType(ItemTypes.Project), true):
false;
executed = executed ?
manager.currentResource.putMethod(this.contentFilePath,
content): false;
executed = executed ?
manager.currentResource.proppatchMethod(contentFilePath,
new PropertyName("DAV:" , EXWebdavResource.TYPE),
ItemTypes.getStringType(ItemTypes.ContentFile), true):
false;
executed = executed ?
manager.currentResource.commitTransaction(): false;
if(executed)
{// here when i try to create the new
WebdavResource the client hangs as i described in my
previous mail
WebProjectItem webProjectItem = new
WebProjectItem(new WebdavResource( new
HttpURL(rootPath)),
manager.getProjectRelativePath(rootPath),
ItemTypes.ProjectMngr);
return webProjectItem;
}
else
{ executed =
manager.currentResource.abortTransaction();
return manager.getLastStatusMessage();
}
}
catch(Exception exc)
{
executed = false;
try
{
manager.currentResource.abortTransaction();
}
catch(Exception transExc){}
return manager.getLastStatusMessage();
}
Some explanation:
manager - is a manager class where i have stored a WebdavResource (currentResource) rootPath - is a full url like "http://test.org:8080/container/Projects/newProject"
The target of this code snipet is:
1. create the "newProject" collection, 2. add a new property like "type" to this collection
3. upload a new file in this collection
4. add a new property to this new file
Thank you.
Here is the log snipet from the server, maybe this helps too.
02 Oct 2004 13:17:23 - org.apache.slide.util.event.EventLogger - INFO - Recieved event with name 'transaction:begin': [EMAIL PROTECTED] http8080-Processor23, 02-Oct-2004 13:17:23, root, LOCK, 200 "OK", 125 ms, /Projects/ 02 Oct 2004 13:17:24 - org.apache.slide.webdav.method.AbstractWebdavMethod - INFO - Using external transaction <opaquelocktoken:50bca276b04d8297918e73a1b87ccf1a> 02 Oct 2004 13:17:24 - org.apache.slide.util.event.EventLogger - INFO - Recieved vetoable event with name 'webdav:mkcol': [EMAIL PROTECTED] 02 Oct 2004 13:17:24 - org.apache.slide.util.event.EventLogger - INFO - Recieved vetoable event with name 'content:create': org.apache.slide.event.ContentEvent[content uri=/Projects/lowproject contentType=] http8080-Processor23, 02-Oct-2004 13:17:24, root, MKCOL, 201 "Created", 188 ms, /Projects/lowproject 02 Oct 2004 13:17:24 - org.apache.slide.webdav.method.AbstractWebdavMethod - INFO - Using external transaction <opaquelocktoken:50bca276b04d8297918e73a1b87ccf1a> 02 Oct 2004 13:17:24 - org.apache.slide.util.event.EventLogger - INFO - Recieved vetoable event with name 'webdav:proppatch': [EMAIL PROTECTED] 02 Oct 2004 13:17:24 - org.apache.slide.util.event.EventLogger - INFO - Recieved vetoable event with name 'content:store': org.apache.slide.event.ContentEvent[content uri=/Projects/lowproject contentType=] http8080-Processor23, 02-Oct-2004 13:17:24, root, PROPPATCH, 207 "Multi-Status", 172 ms, /Projects/lowproject 02 Oct 2004 13:17:24 - org.apache.slide.webdav.method.AbstractWebdavMethod - INFO - Using external transaction <opaquelocktoken:50bca276b04d8297918e73a1b87ccf1a> 02 Oct 2004 13:17:24 - org.apache.slide.util.event.EventLogger - INFO - Recieved vetoable event with name 'webdav:put': [EMAIL PROTECTED] 02 Oct 2004 13:17:25 - org.apache.slide.util.event.EventLogger - INFO - Recieved vetoable event with name 'content:create': org.apache.slide.event.ContentEvent[content uri=/Projects/lowproject/content.xml contentType=text/xml] http8080-Processor23, 02-Oct-2004 13:17:24, root, PUT, 201 "Created", 1328 ms, /Projects/lowproject/content.xml 02 Oct 2004 13:17:26 - org.apache.slide.webdav.method.AbstractWebdavMethod - INFO - Using external transaction <opaquelocktoken:50bca276b04d8297918e73a1b87ccf1a> 02 Oct 2004 13:17:26 - org.apache.slide.util.event.EventLogger - INFO - Recieved vetoable event with name 'webdav:proppatch': [EMAIL PROTECTED] 02 Oct 2004 13:17:26 - org.apache.slide.util.event.EventLogger - INFO - Recieved vetoable event with name 'content:store': org.apache.slide.event.ContentEvent[content uri=/Projects/lowproject/content.xml contentType=text/xml] http8080-Processor23, 02-Oct-2004 13:17:26, root, PROPPATCH, 207 "Multi-Status", 125 ms, /Projects/lowproject/content.xml 02 Oct 2004 13:17:26 - org.apache.slide.util.event.EventLogger - INFO - Recieved vetoable event with name 'transaction:commit': [EMAIL PROTECTED] 02 Oct 2004 13:17:26 - org.apache.slide.util.event.EventLogger - INFO - Recieved vetoable event with name 'event-collection:vetoable-collected': org.apache.slide.event.EventCollection[collected events= [org.apache.slide.event.EventCollection$Event [name=webdav:mkcol]] [org.apache.slide.event.EventCollection$Event [name=content:create, information: uri=/Projects/lowproject]] [org.apache.slide.event.EventCollection$Event [name=webdav:proppatch]] [org.apache.slide.event.EventCollection$Event [name=content:store, information: uri=/Projects/lowproject]] [org.apache.slide.event.EventCollection$Event [name=webdav:put]] [org.apache.slide.event.EventCollection$Event [name=content:create, information: uri=/Projects/lowproject/content.xml]] [org.apache.slide.event.EventCollection$Event [name=webdav:proppatch]] [org.apache.slide.event.EventCollection$Event [name=content:store, information: uri=/Projects/lowproject/content.xml]]] 02 Oct 2004 13:17:26 - org.apache.slide.util.event.EventLogger - INFO - Recieved event with name 'transaction:commited': [EMAIL PROTECTED] http8080-Processor23, 02-Oct-2004 13:17:26, root, UNLOCK, 200 "OK", 218 ms, /Projects/ 02 Oct 2004 13:17:26 - org.apache.slide.util.event.EventLogger - INFO - Recieved event with name 'event-collection:collected': org.apache.slide.event.EventCollection[collected events= [org.apache.slide.event.EventCollection$Event [name=webdav:mkcol]] [org.apache.slide.event.EventCollection$Event [name=content:create, information: uri=/Projects/lowproject]] [org.apache.slide.event.EventCollection$Event [name=webdav:proppatch]] [org.apache.slide.event.EventCollection$Event [name=content:store, information: uri=/Projects/lowproject]] [org.apache.slide.event.EventCollection$Event [name=webdav:put]] [org.apache.slide.event.EventCollection$Event [name=content:create, information: uri=/Projects/lowproject/content.xml]] [org.apache.slide.event.EventCollection$Event [name=webdav:proppatch]] [org.apache.slide.event.EventCollection$Event [name=content:store, information: uri=/Projects/lowproject/content.xml]] [org.apache.slide.event.EventCollection$Event [name=event-collection:vetoable-collected]] [org.apache.slide.event.EventCollection$Event [name=transaction:commit]]] 02 Oct 2004 13:17:26 - org.apache.slide.util.event.EventLogger - INFO - Recieved event with name 'transaction:begin': [EMAIL PROTECTED]
--- Oliver Zeigermann <[EMAIL PROTECTED]> wrote:
Hi Zoltan,
it is pretty hard to tell what is actually going on
without seeing the code. I however suspect the PROPFIND is done on a
resource that is still locked by another transaction that has not been
committed or rolled back. As this is on the server side it is of no use
to restart the client. Try to have something like a commit/rollback
in finally blocks to make very sure all transactions are properly
terminated.
By the way, what is the underlying persistence
store? Depending on this there are different ways to find out what locks are
on what resources. Note that Slide does no additional locking when
running external transactions.
Hope this helps otherwise please show us the code,
Oliver
L Z schrieb:
Hello slide users,
I am using slide 2.1b1 server and client. I tried to use the external transaction feature in
the
following way:
init a WebdavResource startTransaction();
mkcolMethod(); (create a new collection)
proppatchMethod(); (on the newly created
collection)
putMethod(); (put a new file in the newly created collection) commitTransaction();
everything works fine, the resources are created
when
i call the commitTransaction() but after this i am
not
able to create a new WebdavResource() object. I debugged it and i figured out that when the first PROPFIND method is issued (to get the basic properties) the server won't respond. It also don't works if i restart the client. I had
to
restart the server then it works.
Can somebody help me, please?
Thank you, Zoltan.
__________________________________ Do you Yahoo!? Yahoo! Mail - 50x more storage than other
providers!
http://promotions.yahoo.com/new_mail
---------------------------------------------------------------------
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
_______________________________ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
