Re: [jopendocument] jOpenDocumet and multithread

2014-02-28 Thread Sylvain Cuaz

Le 18/02/2014 08:44, Максим Михайлович a écrit :

When I launch at the same time two threads, for filling of ods of
documents, in the second thread in attempt of opening of the document, we
receive Exception:

The library can work multithread?


Hi,

	Not the current version, but in the next one the library itself will be thread-safe. I.e 2 threads 
will be able to use 2 documents concurrently, but one document still cannot be used by 2 threads.


Cheers,
Sylvain

--

--- 
You received this message because you are subscribed to the Google Groups "jOpenDocument" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to jopendocument+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[jopendocument] jOpenDocumet and multithread

2014-02-18 Thread Максим Михайлович
When I launch at the same time two threads, for filling of ods of 
documents, in the second thread in attempt of opening of the document, we 
receive Exception:

java.lang.IllegalStateException: table-row duplicate family
at org.jopendocument.dom.Style.register(Style.java:117)
at org.jopendocument.dom.Style.registerAllVersions(Style.java:109)
at org.jopendocument.dom.spreadsheet.RowStyle.registerDesc(RowStyle.java:41)
at org.jopendocument.dom.Style.loadDescs(Style.java:77)
at org.jopendocument.dom.Style.getStyleDesc(Style.java:246)
at org.jopendocument.dom.Style.getStyleDesc(Style.java:238)
at org.jopendocument.dom.StyledNode.getStyleDesc(StyledNode.java:32)
at 
org.jopendocument.dom.ImmutableDocStyledNode.(ImmutableDocStyledNode.java:47)
at 
org.jopendocument.dom.spreadsheet.TableCalcNode.(TableCalcNode.java:37)
at org.jopendocument.dom.spreadsheet.Table.(Table.java:89)
at org.jopendocument.dom.spreadsheet.Sheet.(Sheet.java:28)
at 
org.jopendocument.dom.spreadsheet.SpreadSheet.getSheet(SpreadSheet.java:308)
at 
org.jopendocument.dom.spreadsheet.SpreadSheet.getSheet(SpreadSheet.java:276)
at JODCalcDocument.openDocument(JODCalcDocument.java:33)

Code:
public void openDocument(String docURL, String sPath) throws IOException {
sRuntimePath = sPath;

File file = new File(docURL);
Spreadsheet = SpreadSheet.createFromFile(file).getSheet(0);
}

The library can work multithread?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"jOpenDocument" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jopendocument+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.