bug? lock. is there some guild on how to do concurrent update in rexq service?

Wednesday, 18 December 2013 · 9 messages · last reply 19 Dec 2013
E
easy18 Dec 2013 10:32 #
hi,all, This is the errror message: Improper use? Potential bug? Your feedback is welcome: Contact: basex-talk at mailman.uni-konstanz.de Version: BaseX 7.7.2 Java: Sun Microsystems Inc., 1.6.0_24 OS: Linux, amd64 Stack Trace: java.lang.IllegalMonitorStateException: Thread already holds one or more locks. at org.basex.core.DBLocking.acquire(DBLocking.java:106) at org.basex.core.Context.register(Context.java:239) at org.basex.http.restxq.RestXqResponse.create(RestXqResponse.java:69) at org.basex.http.restxq.RestXqModule.process(RestXqModule.java:108) at org.basex.http.restxq.RestXqFunction.process(RestXqFunction.java:100) at org.basex.http.restxq.RestXqServlet.run(RestXqServlet.java:31) at org.basex.http.BaseXServlet.service(BaseXServlet.java:58) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684 ) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java :457) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.j ava:137) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.jav a:557) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandl er.java:231) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandl er.java:1075) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java: 384) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandle r.java:193) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandle r.java:1009) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.j ava:135) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper .java:116) at org.eclipse.jetty.server.Server.handle(Server.java:370) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(Abstrac tHttpConnection.java:489) at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpC onnection.java:960) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.conten t(AbstractHttpConnection.java:1021) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnecti on.java:82) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEn dPoint.java:668) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEnd Point.java:52) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPoo l.java:608) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool .java:543) at java.lang.Thread.run(Thread.java:679) Improper use? Potential bug? Your feedback is welcome:
-- 此致 easy 莫愁前路无知己,天下谁人不识君。
JE
Jens Erat18 Dec 2013 10:43 #
This should never happen. Can you reproduce the issue and give us further details on the queries involved? Regards, Jens
-- Jens Erat tel:+49-151-56961126 xmpp:jabber at jenserat.de (preferred messenger) http://www.jenserat.de/conctact (PGP keys, more ways to contact me) -- Sent from my phone. Sorry for typos - damn those touchscreens. No PGP on this device - I will not be able to read your encrypted message before I'm back on my computer.
Quoted text · easy · 80 lines
> Am 18.12.2013 um 10:32 schrieb easy <lin_xd at 126.com>: > > hi,all, > > This is the errror message: > > Improper use? Potential bug? Your feedback is welcome: > Contact: basex-talk at mailman.uni-konstanz.de > Version: BaseX 7.7.2 > Java: Sun Microsystems Inc., 1.6.0_24 > OS: Linux, amd64 > Stack Trace: > java.lang.IllegalMonitorStateException: Thread already holds one or more locks. > at org.basex.core.DBLocking.acquire(DBLocking.java:106) > at org.basex.core.Context.register(Context.java:239) > at org.basex.http.restxq.RestXqResponse.create(RestXqResponse.java:69) > at org.basex.http.restxq.RestXqModule.process(RestXqModule.java:108) > at org.basex.http.restxq.RestXqFunction.process(RestXqFunction.java:100) > at org.basex.http.restxq.RestXqServlet.run(RestXqServlet.java:31) > at org.basex.http.BaseXServlet.service(BaseXServlet.java:58) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) > at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684 > ) > at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java > :457) > at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.j > ava:137) > at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.jav > a:557) > at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandl > er.java:231) > at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandl > er.java:1075) > at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java: > 384) > at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandle > r.java:193) > at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandle > r.java:1009) > at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.j > ava:135) > at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper > .java:116) > at org.eclipse.jetty.server.Server.handle(Server.java:370) > at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(Abstrac > tHttpConnection.java:489) > at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpC > onnection.java:960) > at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.conten > t(AbstractHttpConnection.java:1021) > at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865) > at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240) > at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnecti > on.java:82) > at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEn > dPoint.java:668) > at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEnd > Point.java:52) > at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPoo > l.java:608) > at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool > .java:543) > at java.lang.Thread.run(Thread.java:679) > Improper use? Potential bug? Your feedback is welcome: > > > > > -- > 此致 > > easy > > 莫愁前路无知己,天下谁人不识君。 > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
E
easy18 Dec 2013 20:03 #
Hi,all, I have a web service as fellow :
declare
  %output:method("xml")
  %output:omit-xml-declaration("no")
  %output:media-type("application/xml")
  %updating
  %rest:path("/add_ehr_doc")
  %rest:POST("{$body}")
  %rest:header-param("pid","{$pid}")
  %rest:header-param("doc_id","{$doc_id}")
  %rest:header-param("op","{$op}","APND")
 function ehr:add_ehr_doc(
   $body ,$pid as xs:string,$doc_id as xs:string,$op as xs:string
 )
  {
    (:let $state:=db:open($ehr:dbname):)
    (:let $path:=if(string-length($pid)>=15 and string-length($pid)<=18) then
        substring($pid,1,6)||'/'||substring($pid,7,8)||'/'||substring($pid,15)||
      else
        $pid:)
    let $fp:=substring($pid,1,6)||'/'||substring($pid,7,8)||'/'||substring($pid,15)||'.xml'
    return
    if (db:exists($ehr:dbname,$fp)) then
       (
         insert node ($body//*:DataSet) into (doc($ehr:dbname||"/"||$fp)//*:BasicDataset),db:output(<msg>
ppend</Ack><Url>{$fp}</Url></msg>)          )
   else
     (    db:add($ehr:dbname, $body,$fp),db:output(<msg><Ack>201 new add</Ack><Url>{$fp}</Url></msg>)
       )
 };
then there is a process call the service continuously. some times, will occur this error. 10:00:10.663 10.8.252.93:40461 admin REQUEST [POST] http://10.8.252.91:8984/add_ehr_doc 10:00:10.669 10.8.252.93:40461 admin 500 Unexpected error: Improper use? Potential bug? Your feedbac k is welcome: Contact: basex-talk at mailman.uni-konstanz.de Version: BaseX 7.7.2 Java: Sun Microsystems Inc., 1.6.0_2 4 OS: Linux, amd64 Stack Trace: java.lang.IllegalMonitorStateException: Thread already holds one or more locks. at org.basex.core.DBLocking.acquire(DBLocking.java:106) at org.basex.core.Context.register(Context.java:239) at org.ba sex.http.restxq.RestXqResponse.create(RestXqResponse.java:69) at org.basex.http.restxq.RestXqModule.process(RestXqM odule.java:108) at org.basex.http.restxq.RestXqFunction.process(RestXqFunction.java:100) at org.basex.http.restxq.R estXqServlet.run(RestXqServlet.java:31) at org.basex.http.BaseXServlet.service(BaseXServlet.java:58) at javax.servl et.http.HttpServlet.service(HttpServlet.java:848) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.j ava:684) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:457) at org.eclipse.jetty.server. handler.ScopedHand... 5.36 ms
CG
Christian Grün18 Dec 2013 20:06 #
Hi Easy, I guess the problem has been fixed in the 7.8 snapshot. Could you please give it a try and report back? Best, Christian
Quoted text · easy · 76 lines
Am 18.12.2013 20:04 schrieb "easy" <lin_xd at 126.com>: > Hi,all, > I have a web service as fellow : > > declare > %output:method("xml") > %output:omit-xml-declaration("no") > %output:media-type("application/xml") > %updating > %rest:path("/add_ehr_doc") > %rest:POST("{$body}") > %rest:header-param("pid","{$pid}") > %rest:header-param("doc_id","{$doc_id}") > %rest:header-param("op","{$op}","APND") > function ehr:add_ehr_doc( > $body ,$pid as xs:string,$doc_id as xs:string,$op as xs:string > ) > { > (:let $state:=db:open($ehr:dbname):) > (:let $path:=if(string-length($pid)>=15 and string-length($pid)<=18) > then > > substring($pid,1,6)||'/'||substring($pid,7,8)||'/'||substring($pid,15)|| > else > $pid:) > let > $fp:=substring($pid,1,6)||'/'||substring($pid,7,8)||'/'||substring($pid,15)||'.xml' > return > if (db:exists($ehr:dbname,$fp)) then > ( > insert node ($body//*:DataSet) into > (doc($ehr:dbname||"/"||$fp)//*:BasicDataset),db:output(<msg> > ppend</Ack><Url>{$fp}</Url></msg>) ) > else > ( db:add($ehr:dbname, $body,$fp),db:output(<msg><Ack>201 new > add</Ack><Url>{$fp}</Url></msg>) > ) > }; > > > then there is a process call the service continuously. some times, will > occur this error. > > 10:00:10.663 10.8.252.93:40461 admin REQUEST [POST] > http://10.8.252.91:8984/add_ehr_doc > 10:00:10.669 10.8.252.93:40461 admin 500 Unexpected error: > Improper use? Potential bug? Your feedbac > k is welcome: Contact: basex-talk at mailman.uni-konstanz.de Version: BaseX > 7.7.2 Java: Sun Microsystems Inc., 1.6.0_2 > 4 OS: Linux, amd64 Stack Trace: java.lang.IllegalMonitorStateException: > Thread already holds one or more locks. at > org.basex.core.DBLocking.acquire(DBLocking.java:106) at > org.basex.core.Context.register(Context.java:239) at org.ba > sex.http.restxq.RestXqResponse.create(RestXqResponse.java:69) at > org.basex.http.restxq.RestXqModule.process(RestXqM > odule.java:108) at > org.basex.http.restxq.RestXqFunction.process(RestXqFunction.java:100) at > org.basex.http.restxq.R > estXqServlet.run(RestXqServlet.java:31) at > org.basex.http.BaseXServlet.service(BaseXServlet.java:58) at javax.servl > et.http.HttpServlet.service(HttpServlet.java:848) at > org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.j > ava:684) at > org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:457) > at org.eclipse.jetty.server. > handler.ScopedHand... 5.36 ms > > > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > >
E
easy19 Dec 2013 06:35 #
Thanks. I will try, but the database can't access, open will report error:
  optimize
Improper use? Potential bug? Your feedback is welcome:
Contact: basex-talk at mailman.uni-konstanz.de
Version: BaseX 7.7.2
Java: Sun Microsystems Inc., 1.6.0_24
OS: Linux, amd64
Stack Trace:
java.lang.RuntimeException: Data Access out of bounds:
- pre value: 0
- #used blocks: 0
- #total locks: 0
- access: -1 (0 > -1]
        at org.basex.util.Util.notexpected(Util.java:53)
        at org.basex.io.random.TableDiskAccess.cursor(TableDiskAccess.java:488)
        at org.basex.io.random.TableDiskAccess.read1(TableDiskAccess.java:189)
        at org.basex.data.Data.kind(Data.java:282)
        at org.basex.index.resource.Docs.docs(Docs.java:87)
        at org.basex.index.resource.Docs.init(Docs.java:75)
        at org.basex.index.resource.Resources.init(Resources.java:64)
        at org.basex.core.cmd.Optimize.optimize(Optimize.java:80)
        at org.basex.core.cmd.Optimize.run(Optimize.java:42)
        at org.basex.core.Command.run(Command.java:345)
        at org.basex.core.Command.exec(Command.java:321)
        at org.basex.core.Command.execute(Command.java:78)
        at org.basex.server.LocalSession.execute(LocalSession.java:122)
        at org.basex.server.Session.execute(Session.java:37)
        at org.basex.core.Main.execute(Main.java:146)
        at org.basex.core.Main.execute(Main.java:130)
        at org.basex.core.Main.console(Main.java:90)
        at org.basex.BaseX.<init>(BaseX.java:168)
        at org.basex.BaseX.main(BaseX.java:38)
-- 此致 easy 莫愁前路无知己,天下谁人不识君。
Quoted text · Christian Grün · 1 line
At 2013-12-19 03:06:45,"Christian Grün" <christian.gruen at gmail.com> wrote:
Hi Easy, I guess the problem has been fixed in the 7.8 snapshot. Could you please give it a try and report back? Best, Christian
Quoted text · Christian Grün · 1 line
Am 18.12.2013 20:04 schrieb "easy" <lin_xd at 126.com>:
Hi,all, I have a web service as fellow : declare %output:method("xml") %output:omit-xml-declaration("no") %output:media-type("application/xml") %updating %rest:path("/add_ehr_doc") %rest:POST("{$body}") %rest:header-param("pid","{$pid}") %rest:header-param("doc_id","{$doc_id}") %rest:header-param("op","{$op}","APND") function ehr:add_ehr_doc( $body ,$pid as xs:string,$doc_id as xs:string,$op as xs:string ) { (:let $state:=db:open($ehr:dbname):) (:let $path:=if(string-length($pid)>=15 and string-length($pid)<=18) then substring($pid,1,6)||'/'||substring($pid,7,8)||'/'||substring($pid,15)|| else $pid:) let $fp:=substring($pid,1,6)||'/'||substring($pid,7,8)||'/'||substring($pid,15)||'.xml' return if (db:exists($ehr:dbname,$fp)) then ( insert node ($body//*:DataSet) into (doc($ehr:dbname||"/"||$fp)//*:BasicDataset),db:output(<msg> ppend</Ack><Url>{$fp}</Url></msg>) ) else ( db:add($ehr:dbname, $body,$fp),db:output(<msg><Ack>201 new add</Ack><Url>{$fp}</Url></msg>) ) }; then there is a process call the service continuously. some times, will occur this error. 10:00:10.663 10.8.252.93:40461 admin REQUEST [POST] http://10.8.252.91:8984/add_ehr_doc 10:00:10.669 10.8.252.93:40461 admin 500 Unexpected error: Improper use? Potential bug? Your feedbac k is welcome: Contact: basex-talk at mailman.uni-konstanz.de Version: BaseX 7.7.2 Java: Sun Microsystems Inc., 1.6.0_2 4 OS: Linux, amd64 Stack Trace: java.lang.IllegalMonitorStateException: Thread already holds one or more locks. at org.basex.core.DBLocking.acquire(DBLocking.java:106) at org.basex.core.Context.register(Context.java:239) at org.ba sex.http.restxq.RestXqResponse.create(RestXqResponse.java:69) at org.basex.http.restxq.RestXqModule.process(RestXqM odule.java:108) at org.basex.http.restxq.RestXqFunction.process(RestXqFunction.java:100) at org.basex.http.restxq.R estXqServlet.run(RestXqServlet.java:31) at org.basex.http.BaseXServlet.service(BaseXServlet.java:58) at javax.servl et.http.HttpServlet.service(HttpServlet.java:848) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.j ava:684) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:457) at org.eclipse.jetty.server. handler.ScopedHand... 5.36 ms _______________________________________________ BaseX-Talk mailing list BaseX-Talk at mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
CG
Christian Grün19 Dec 2013 11:53 #
Quoted text · easy · 2 lines
> optimize > Improper use? Potential bug? Your feedback is welcome:
Does the error occur when opening the database, or when you try to optimize it? In the latter case, you could tr the "optimize all" command. In the first case, it seems your data itself has got corrupt. In this case, you’ll need to create a new database, or restore an existing backup. Please read our article on transactions to get to know more about locking problems: http://docs.basex.org/wiki/Transactions Christian
Quoted text · easy · 135 lines
On Thu, Dec 19, 2013 at 6:35 AM, easy <lin_xd at 126.com> wrote: > > Thanks. > I will try, but the database can't access, open will report error: > > > Contact: basex-talk at mailman.uni-konstanz.de > Version: BaseX 7.7.2 > Java: Sun Microsystems Inc., 1.6.0_24 > OS: Linux, amd64 > Stack Trace: > java.lang.RuntimeException: Data Access out of bounds: > - pre value: 0 > - #used blocks: 0 > - #total locks: 0 > - access: -1 (0 > -1] > at org.basex.util.Util.notexpected(Util.java:53) > at > org.basex.io.random.TableDiskAccess.cursor(TableDiskAccess.java:488) > at > org.basex.io.random.TableDiskAccess.read1(TableDiskAccess.java:189) > at org.basex.data.Data.kind(Data.java:282) > at org.basex.index.resource.Docs.docs(Docs.java:87) > at org.basex.index.resource.Docs.init(Docs.java:75) > at org.basex.index.resource.Resources.init(Resources.java:64) > at org.basex.core.cmd.Optimize.optimize(Optimize.java:80) > at org.basex.core.cmd.Optimize.run(Optimize.java:42) > at org.basex.core.Command.run(Command.java:345) > at org.basex.core.Command.exec(Command.java:321) > at org.basex.core.Command.execute(Command.java:78) > at org.basex.server.LocalSession.execute(LocalSession.java:122) > at org.basex.server.Session.execute(Session.java:37) > at org.basex.core.Main.execute(Main.java:146) > at org.basex.core.Main.execute(Main.java:130) > at org.basex.core.Main.console(Main.java:90) > at org.basex.BaseX.<init>(BaseX.java:168) > at org.basex.BaseX.main(BaseX.java:38) > > > > -- > 此致 > > easy > > 莫愁前路无知己,天下谁人不识君。 > > At 2013-12-19 03:06:45,"Christian Grün" <christian.gruen at gmail.com> wrote: > > Hi Easy, > > I guess the problem has been fixed in the 7.8 snapshot. Could you please > give it a try and report back? > > Best, > Christian > > Am 18.12.2013 20:04 schrieb "easy" <lin_xd at 126.com>: >> >> Hi,all, >> I have a web service as fellow : >> >> declare >> %output:method("xml") >> %output:omit-xml-declaration("no") >> %output:media-type("application/xml") >> %updating >> %rest:path("/add_ehr_doc") >> %rest:POST("{$body}") >> %rest:header-param("pid","{$pid}") >> %rest:header-param("doc_id","{$doc_id}") >> %rest:header-param("op","{$op}","APND") >> function ehr:add_ehr_doc( >> $body ,$pid as xs:string,$doc_id as xs:string,$op as xs:string >> ) >> { >> (:let $state:=db:open($ehr:dbname):) >> (:let $path:=if(string-length($pid)>=15 and string-length($pid)<=18) >> then >> >> substring($pid,1,6)||'/'||substring($pid,7,8)||'/'||substring($pid,15)|| >> else >> $pid:) >> let >> $fp:=substring($pid,1,6)||'/'||substring($pid,7,8)||'/'||substring($pid,15)||'.xml' >> return >> if (db:exists($ehr:dbname,$fp)) then >> ( >> insert node ($body//*:DataSet) into >> (doc($ehr:dbname||"/"||$fp)//*:BasicDataset),db:output(<msg> >> ppend</Ack><Url>{$fp}</Url></msg>) ) >> else >> ( db:add($ehr:dbname, $body,$fp),db:output(<msg><Ack>201 new >> add</Ack><Url>{$fp}</Url></msg>) >> ) >> }; >> >> >> then there is a process call the service continuously. some times, will >> occur this error. >> >> 10:00:10.663 10.8.252.93:40461 admin REQUEST [POST] >> http://10.8.252.91:8984/add_ehr_doc >> 10:00:10.669 10.8.252.93:40461 admin 500 Unexpected error: >> Improper use? Potential bug? Your feedbac >> k is welcome: Contact: basex-talk at mailman.uni-konstanz.de Version: BaseX >> 7.7.2 Java: Sun Microsystems Inc., 1.6.0_2 >> 4 OS: Linux, amd64 Stack Trace: java.lang.IllegalMonitorStateException: >> Thread already holds one or more locks. at >> org.basex.core.DBLocking.acquire(DBLocking.java:106) at >> org.basex.core.Context.register(Context.java:239) at org.ba >> sex.http.restxq.RestXqResponse.create(RestXqResponse.java:69) at >> org.basex.http.restxq.RestXqModule.process(RestXqM >> odule.java:108) at >> org.basex.http.restxq.RestXqFunction.process(RestXqFunction.java:100) at >> org.basex.http.restxq.R >> estXqServlet.run(RestXqServlet.java:31) at >> org.basex.http.BaseXServlet.service(BaseXServlet.java:58) at javax.servl >> et.http.HttpServlet.service(HttpServlet.java:848) at >> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.j >> ava:684) at >> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:457) >> at org.eclipse.jetty.server. >> handler.ScopedHand... 5.36 ms >> >> >> >> >> _______________________________________________ >> BaseX-Talk mailing list >> BaseX-Talk at mailman.uni-konstanz.de >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >> > >
JE
Jens Eratin reply to easy, 18 Dec 2013, 20:0319 Dec 2013 19:42 #
Hi, are you using RESTXQ-`forward`s or `redirect`s, and redirecting to this function call? We have been investigating your issue a little bit, but have not been able to reproduce it yet. Did you ever have problems with that database? It might have been broken before this issue. Can you verify the database using the INSPECT command? It would be very helpful if you could test it using the most current BaseX 7.8 Beta release, and if you’re able to reproduce it (you’re writing it sometimes happens; can you have an estimation on how often it happens: ratio error calls vs successful calls)? Regards, Jens
-- Jens Erat [phone]: tel:+49-151-56961126 [mail]: mailto:email at jenserat.de [jabber]: xmpp:jabber at jenserat.de [web]: http://www.jenserat.de PGP: 350E D9B6 9ADC 2DED F5F2 8549 CBC2 613C D745 722B
Quoted text · easy · 51 lines
Am 18.12.2013 um 20:03 schrieb easy <lin_xd at 126.com>: >> Hi,all, >> I have a web service as fellow : >> >> declare >> %output:method("xml") >> %output:omit-xml-declaration("no") >> %output:media-type("application/xml") >> %updating >> %rest:path("/add_ehr_doc") >> %rest:POST("{$body}") >> %rest:header-param("pid","{$pid}") >> %rest:header-param("doc_id","{$doc_id}") >> %rest:header-param("op","{$op}","APND") >> function ehr:add_ehr_doc( >> $body ,$pid as xs:string,$doc_id as xs:string,$op as xs:string >> ) >> { >> (:let $state:=db:open($ehr:dbname):) >> (:let $path:=if(string-length($pid)>=15 and string-length($pid)<=18) then >> substring($pid,1,6)||'/'||substring($pid,7,8)||'/'||substring($pid,15)|| >> else >> $pid:) >> let $fp:=substring($pid,1,6)||'/'||substring($pid,7,8)||'/'||substring($pid,15)||'.xml' >> return >> if (db:exists($ehr:dbname,$fp)) then >> ( >> insert node ($body//*:DataSet) into (doc($ehr:dbname||"/"||$fp)//*:BasicDataset),db:output(<msg> >> ppend</Ack><Url>{$fp}</Url></msg>) ) >> else >> ( db:add($ehr:dbname, $body,$fp),db:output(<msg><Ack>201 new add</Ack><Url>{$fp}</Url></msg>) >> ) >> }; >> >> >> then there is a process call the service continuously. some times, will occur this error. >> >> 10:00:10.663 10.8.252.93:40461 admin REQUEST [POST] http://10.8.252.91:8984/add_ehr_doc >> 10:00:10.669 10.8.252.93:40461 admin 500 Unexpected error: Improper use? Potential bug? Your feedbac >> k is welcome: Contact: basex-talk at mailman.uni-konstanz.de Version: BaseX 7.7.2 Java: Sun Microsystems Inc., 1.6.0_2 >> 4 OS: Linux, amd64 Stack Trace: java.lang.IllegalMonitorStateException: Thread already holds one or more locks. at >> org.basex.core.DBLocking.acquire(DBLocking.java:106) at org.basex.core.Context.register(Context.java:239) at org.ba >> sex.http.restxq.RestXqResponse.create(RestXqResponse.java:69) at org.basex.http.restxq.RestXqModule.process(RestXqM >> odule.java:108) at org.basex.http.restxq.RestXqFunction.process(RestXqFunction.java:100) at org.basex.http.restxq.R >> estXqServlet.run(RestXqServlet.java:31) at org.basex.http.BaseXServlet.service(BaseXServlet.java:58) at javax.servl >> et.http.HttpServlet.service(HttpServlet.java:848) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.j >> ava:684) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:457) at org.eclipse.jetty.server. >> handler.ScopedHand... 5.36 ms >> > >
E
easy19 Dec 2013 19:53 #
Thanks. I have created a new database , can't reproduce it. BYW, is there a way to scheduler backup task?
-- 此致 easy 莫愁前路无知己,天下谁人不识君。
Quoted text · Jens Erat · 75 lines
At 2013-12-20 02:42:45,"Jens Erat" <jens.erat at uni-konstanz.de> wrote: >Hi, > >are you using RESTXQ-`forward`s or `redirect`s, and redirecting to this function call? We have been investigating your issue a little bit, but have not been able to reproduce it yet. Did you ever have problems with that database? It might have been broken before this issue. Can you verify the database using the `INSPECT` command? > >It would be very helpful if you could test it using the most current BaseX 7.8 Beta release, and if you’re able to reproduce it (you’re writing it sometimes happens; can you have an estimation on how often it happens: ratio error calls vs successful calls)? > >Regards, >Jens > >-- >Jens Erat > > [phone]: tel:+49-151-56961126 > [mail]: mailto:email at jenserat.de >[jabber]: xmpp:jabber at jenserat.de > [web]: http://www.jenserat.de > > PGP: 350E D9B6 9ADC 2DED F5F2 8549 CBC2 613C D745 722B > > > >Am 18.12.2013 um 20:03 schrieb easy <lin_xd at 126.com>: > >>> Hi,all, >>> I have a web service as fellow : >>> >>> declare >>> %output:method("xml") >>> %output:omit-xml-declaration("no") >>> %output:media-type("application/xml") >>> %updating >>> %rest:path("/add_ehr_doc") >>> %rest:POST("{$body}") >>> %rest:header-param("pid","{$pid}") >>> %rest:header-param("doc_id","{$doc_id}") >>> %rest:header-param("op","{$op}","APND") >>> function ehr:add_ehr_doc( >>> $body ,$pid as xs:string,$doc_id as xs:string,$op as xs:string >>> ) >>> { >>> (:let $state:=db:open($ehr:dbname):) >>> (:let $path:=if(string-length($pid)>=15 and string-length($pid)<=18) then >>> substring($pid,1,6)||'/'||substring($pid,7,8)||'/'||substring($pid,15)|| >>> else >>> $pid:) >>> let $fp:=substring($pid,1,6)||'/'||substring($pid,7,8)||'/'||substring($pid,15)||'.xml' >>> return >>> if (db:exists($ehr:dbname,$fp)) then >>> ( >>> insert node ($body//*:DataSet) into (doc($ehr:dbname||"/"||$fp)//*:BasicDataset),db:output(<msg> >>> ppend</Ack><Url>{$fp}</Url></msg>) ) >>> else >>> ( db:add($ehr:dbname, $body,$fp),db:output(<msg><Ack>201 new add</Ack><Url>{$fp}</Url></msg>) >>> ) >>> }; >>> >>> >>> then there is a process call the service continuously. some times, will occur this error. >>> >>> 10:00:10.663 10.8.252.93:40461 admin REQUEST [POST] http://10.8.252.91:8984/add_ehr_doc >>> 10:00:10.669 10.8.252.93:40461 admin 500 Unexpected error: Improper use? Potential bug? Your feedbac >>> k is welcome: Contact: basex-talk at mailman.uni-konstanz.de Version: BaseX 7.7.2 Java: Sun Microsystems Inc., 1.6.0_2 >>> 4 OS: Linux, amd64 Stack Trace: java.lang.IllegalMonitorStateException: Thread already holds one or more locks. at >>> org.basex.core.DBLocking.acquire(DBLocking.java:106) at org.basex.core.Context.register(Context.java:239) at org.ba >>> sex.http.restxq.RestXqResponse.create(RestXqResponse.java:69) at org.basex.http.restxq.RestXqModule.process(RestXqM >>> odule.java:108) at org.basex.http.restxq.RestXqFunction.process(RestXqFunction.java:100) at org.basex.http.restxq.R >>> estXqServlet.run(RestXqServlet.java:31) at org.basex.http.BaseXServlet.service(BaseXServlet.java:58) at javax.servl >>> et.http.HttpServlet.service(HttpServlet.java:848) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.j >>> ava:684) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:457) at org.eclipse.jetty.server. >>> handler.ScopedHand... 5.36 ms >>> >> >> >
JE
Jens Erat19 Dec 2013 19:55 #
Quoted text · easy · 1 line
> BYW, is there a way to scheduler backup task?
You could use cron jobs for that, calling basexclient with the backup command.
-- Jens Erat [phone]: tel:+49-151-56961126 [mail]: mailto:email at jenserat.de [jabber]: xmpp:jabber at jenserat.de [web]: http://www.jenserat.de PGP: 350E D9B6 9ADC 2DED F5F2 8549 CBC2 613C D745 722B
Quoted text · easy · 93 lines
Am 19.12.2013 um 19:53 schrieb easy <lin_xd at 126.com>: > > > Thanks. I have created a new database , can't reproduce it. > BYW, is there a way to scheduler backup task? > > > -- > 此致 > > easy > > 莫愁前路无知己,天下谁人不识君。 > > > At 2013-12-20 02:42:45,"Jens Erat" <jens.erat at uni-konstanz.de> wrote: > >Hi, > > > >are you using RESTXQ-`forward`s or `redirect`s, and redirecting to this function call? We have been investigating your issue a little bit, but have not been able to reproduce it yet. Did you ever have problems with that database? It might have been broken before this issue. Can you verify the database using the `INSPECT` command? > > > >It would be very helpful if you could test it using the most current BaseX 7.8 Beta release, and if you’re able to reproduce it (you’re writing it sometimes happens; can you have an estimation on how often it happens: ratio error calls vs successful calls)? > > > >Regards, > >Jens > > > >-- > >Jens Erat > > > > [phone]: tel:+49-151-56961126 > > [mail]: mailto:email at jenserat.de > >[jabber]: xmpp:jabber at jenserat.de > > [web]: http://www.jenserat.de > > > > PGP: 350E D9B6 9ADC 2DED F5F2 8549 CBC2 613C D745 722B > > > > > > > >Am 18.12.2013 um 20:03 schrieb easy <lin_xd at 126.com>: > > > >>> Hi,all, > >>> I have a web service as fellow : > >>> > >>> declare > >>> %output:method("xml") > >>> %output:omit-xml-declaration("no") > >>> %output:media-type("application/xml") > >>> %updating > >>> %rest:path("/add_ehr_doc") > >>> %rest:POST("{$body}") > >>> %rest:header-param("pid","{$pid}") > >>> %rest:header-param("doc_id","{$doc_id}") > >>> %rest:header-param("op","{$op}","APND") > >>> function ehr:add_ehr_doc( > >>> $body ,$pid as xs:string,$doc_id as xs:string,$op as xs:string > >>> ) > >>> { > >>> (:let $state:=db:open($ehr:dbname):) > >>> (:let $path:=if(string-length($pid)>=15 and string-length($pid)<=18) then > >>> substring($pid,1,6)||'/'||substring($pid,7,8)||'/'||substring($pid,15)|| > >>> else > >>> $pid:) > >>> let $fp:=substring($pid,1,6)||'/'||substring($pid,7,8)||'/'||substring($pid,15)||'.xml' > >>> return > >>> if (db:exists($ehr:dbname,$fp)) then > >>> ( > >>> insert node ($body//*:DataSet) into (doc($ehr:dbname||"/"||$fp)//*:BasicDataset),db:output(<msg> > >>> ppend</Ack><Url>{$fp}</Url></msg>) ) > >>> else > >>> ( db:add($ehr:dbname, $body,$fp),db:output(<msg><Ack>201 new add</Ack><Url>{$fp}</Url></msg>) > >>> ) > >>> }; > >>> > >>> > >>> then there is a process call the service continuously. some times, will occur this error. > >>> > >>> 10:00:10.663 10.8.252.93:40461 admin REQUEST [POST] http://10.8.252.91:8984/add_ehr_doc > >>> 10:00:10.669 10.8.252.93:40461 admin 500 Unexpected error: Improper use? Potential bug? Your feedbac > >>> k is welcome: Contact: basex-talk at mailman.uni-konstanz.de Version: BaseX 7.7.2 Java: Sun Microsystems Inc., 1.6.0_2 > >>> 4 OS: Linux, amd64 Stack Trace: java.lang.IllegalMonitorStateException: Thread already holds one or more locks. at > >>> org.basex.core.DBLocking.acquire(DBLocking.java:106) at org.basex.core.Context.register(Context.java:239) at org.ba > >>> sex.http.restxq.RestXqResponse.create(RestXqResponse.java:69) at org.basex.http.restxq.RestXqModule.process(RestXqM > >>> odule.java:108) at org.basex.http.restxq.RestXqFunction.process(RestXqFunction.java:100) at org.basex.http.restxq.R > >>> estXqServlet.run(RestXqServlet.java:31) at org.basex.http.BaseXServlet.service(BaseXServlet.java:58) at javax.servl > >>> et.http.HttpServlet.service(HttpServlet.java:848) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.j > >>> ava:684) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:457) at org.eclipse.jetty.server. > >>> handler.ScopedHand... 5.36 ms > >>> > >> > >> > > > > >

⚡Generated with XQuery