I'm trying to batch load thousands of documents in batch mode, as in single doc mode takes too long. I guess the SPI would come handy this way.

Do I have to implement the interface? There's no such implementation provided in any of the jackrabbit distribution jar files?

Can someone please provide sample code for batch importing documents (nodes with file attachments)?


Gonzalo Vásquez Sáez
Gerente Investigación y Desarrollo (R&D)
Altiuz Soluciones Tecnológicas de Negocios Ltda.
Av. Nueva Tajamar 555 Of. 802, Las Condes
(56-2) 335 2461

El 19-04-2012, a las 15:08, Michael Dürig escribió:

On 19.4.12 17:34, Gonzalo Vasquez wrote:
Understood! "All over the place" seems to be the key, but under that
conditions how do I retrieve the root NodeId? I guess using the the
RepositoryService might help, but the only method I can think of is the
executeQuery, isn't there an equivalent for Session.getRootNode() from
javax.jcr? I need to traverse a tree of nodes prior to the batch insert


What are you trying to achieve here? If you implement the SPI, you basically have to implement the RepositoryService interface. In that casse you don't get the root NodeId from anywhere, but you rather have to supply it yourself. See PathFactory and IdFactory.


Any SPI code tutorials available?

*Gonzalo Vásquez Sáez*
*Gerente Investigación y Desarrollo (R&D)*
*Altiuz*Soluciones Tecnológicas de Negocios Ltda.
Av. Nueva Tajamar 555 Of. 802, Las Condes
(56-2) 335 2461
_gvasquez@altiuz.c <mailto:gcoppa@altiuz.com>l_
___http://www.altiuz.cl <http://www.altiuz.cl/>_

El 19-04-2012, a las 11:18, Julian Reschke escribió:

On 2012-04-18 16:53, Gonzalo Vasquez wrote:
I'm trying to use the org.apache.jackrabbit.spi.Batch class methods
provided by the SPI package (jackrabbit-spi-2.4.1.jar), but I'm having
trouble discovering how to get the NodeId param as the one it needs is
from the spi package, not from the core one. Some Helper / Factory class

Any ideas would be appreciated!


The Batch class is needed to implement write operations in an SPI
implementation. In which case, you should be using spi.NodeIds all
over the place...

Can you clarify what you're trying to do?

Best regards, Julian