Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

triggers: after-create-document event does not fire when a document is created as a result of another trigger #229

Open
mbreeb opened this issue Jun 6, 2014 · 3 comments
Labels
bug issue confirmed as bug

Comments

@mbreeb
Copy link

mbreeb commented Jun 6, 2014

Suppose there is a trigger on collection A set by a collection.xconf. Adding a file to collection A triggers an XQuery which reads the file and creates new files Q1; Q2; etc. in collection B. The XQuery uses the xmldb:store function to create these files.

As collection B is a sibling from collection A, there is a different collection.xconf on B. This one sets a after-document-create event which should execute an XQuery.

The issue is that the trigger on collection B only works when I manually add a file to collection B. This trigger does not respond to trigger A writing an XML file with xmldb:store into collection B. I think it should not matter whether the file was created through webdav or through xmldb:store.

(http://stackoverflow.com/questions/24085735/exist-db-triggers-after-create-document-event-does-not-fire-when-a-document-is
eXist Version: 2.1
eXist Build: 20130717
eXist Home: /Users/matthijs/Java_Apps/eXist-db/Java_Apps
SVN Revision: 18721
Operating System: Mac OS X 10.9.3 x86_64
File encoding: UTF-8
Java
Vendor: Apple Inc.
Version: 1.6.0_65
)

@shabanovd
Copy link
Member

Can you give database backup with prepared environment for tests?

On Fri, Jun 6, 2014 at 11:27 PM, mbreeb [email protected] wrote:

Suppose there is a trigger on collection A set by a collection.xconf.
Adding a file to collection A triggers an XQuery which reads the file and
creates new files Q1; Q2; etc. in collection B. The XQuery uses the
xmldb:store function to create these files.

As collection B is a sibling from collection A, there is a different
collection.xconf on B. This one sets a after-document-create event which
should execute an XQuery.

The issue is that the trigger on collection B only works when I
manually add a file to collection B. This trigger does not respond to
trigger A writing an XML file with xmldb:store into collection B. I think
it should not matter whether the file was created through webdav or through
xmldb:store.


Reply to this email directly or view it on GitHub
#229.

Dmitriy Shabanov

@mbreeb
Copy link
Author

mbreeb commented Jun 8, 2014

Backup of the database can be found here: https://www.dropbox.com/s/19axqdtqphgqo3e/full20140608-2324.zip

Files necessary are:
A
/Volumes/db/system/config/db/OEP/repository/collection.xconf update triggers /db/OEP/code/process_updated_manifest.xql
which writes to /db/OEP/jobs

B
/Volumes/db/system/config/db/OEP/jobs/collection.xconf create triggers
/db/OEP/code/process_new_job.xql

B trigger does not run when A writes XML into /db/OEP/jobs

@cmisztur
Copy link

I am experiencing this as well in 2.2 RTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issue confirmed as bug
Projects
None yet
Development

No branches or pull requests

4 participants