Hi, are you using a transaction around your code? changes to the repository are only searchable when the transaction is committed.
regards marcel tremek wrote: > Hi. > In one function i add new node some like this: > Node rootNode = session.getRootNode(); > Node kTNode = rootNode.addNode("nameNode","nt:folder"); > session.save; > Next i make a Query.XPATH query like this: > StringBuffer query = new StringBuffer(); > query.append("/jcr:root//element(*,nt:folder)"); > Workspace ws = session.getWorkspace(); > QueryManager qm = ws.getQueryManager(); > Query querySql = qm.createQuery(query.toString(),Query.XPATH); > QueryResult result = querySql.execute(); > for (NodeIterator it = result.getNodes(); it.hasNext(); ) > { > //make something > } > The resultset is empty. I noticed, that ItemState of kTNode is STATUS_NEW. > How to search nodes when them ItemState is STATUS_NEW. > When i do search in other function, the state of this node is > STATUS_UNDEFINED and it works fine. > Or how to change ItemState of node from STATUS_NEW to STATUS_UNDEFINED?. >