Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Job Schedule in Mongodb

Received: by 10.42.132.5 with SMTP id b5mr11998571ict.7.1349831113079;
        Tue, 09 Oct 2012 18:05:13 -0700 (PDT)
X-BeenThere: mongodb-user@googlegroups.com
Received: by 10.42.102.12 with SMTP id g12ls16844961ico.4.gmail; Tue, 09 Oct
 2012 18:05:02 -0700 (PDT)
Received: by 10.42.94.16 with SMTP id z16mr12570690icm.32.1349831102056;
        Tue, 09 Oct 2012 18:05:02 -0700 (PDT)
Received: by 10.42.94.16 with SMTP id z16mr12570689icm.32.1349831102029;
        Tue, 09 Oct 2012 18:05:02 -0700 (PDT)
Return-Path: <tom...@nexcel.vn>
Received: from mail-ie0-f177.google.com (mail-ie0-f177.google.com [209.85.223.177])
        by gmr-mx.google.com with ESMTPS id s15si1898853igi.1.2012.10.09.18.05.01
        (version=TLSv1/SSLv3 cipher=OTHER);
        Tue, 09 Oct 2012 18:05:01 -0700 (PDT)
Received-SPF: neutral (google.com: 209.85.223.177 is neither permitted nor denied by best guess record for domain of tom...@nexcel.vn) client-ip=209.85.223.177;
Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 209.85.223.177 is neither permitted nor denied by best guess record for domain of tom...@nexcel.vn) smtp.mail=tom...@nexcel.vn
Received: by mail-ie0-f177.google.com with SMTP id e14so16517869iej.22
        for <mongodb-user@googlegroups.com>; Tue, 09 Oct 2012 18:05:01 -0700 (PDT)
        d=google.com; s=20120113;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type:x-gm-message-state;
        bh=ZAhAbgsjhcPjm0ltuSrNH52d+oXdqodKeol/ymAoLxI=;
        b=Qs2c1gDqqk/Fsa7PNHM5wq2lrulQhzoEkLMElm6M9tfTuemj0OtZUqgXcPuwXSce6K
         qW66+ElzhqXWqvRrLuvX37ScoltlF+9aFy/dJM2LjHjXZOhGu4lpy9MYD8CJwPQ61AxL
         18mjeYfxTCk8BHXaWNUe4nf5uekTRgixGDfsrXtZC2trM0Oq5dsLqlcusGy2leSc6OAV
         mS8Gm/3aVt2f+1fPmdfEz9SWKH6MuX7wap2gqxE9018rHvpgH1J16BEhOwyrjsJTKi+D
         U8MCaaWouid7jW0F501FOlH8FiFGy40iYPxJ1gL+jfxPO1xwt8wxKlEWuHO+mW2UGLSF
         PJMg==
MIME-Version: 1.0
Received: by 10.42.95.10 with SMTP id d10mr17129493icn.30.1349831101007; Tue,
 09 Oct 2012 18:05:01 -0700 (PDT)
Received: by 10.64.39.14 with HTTP; Tue, 9 Oct 2012 18:05:00 -0700 (PDT)
In-Reply-To: <9f94a296-33f8-49eb-a9a5-f48095f15639@googlegroups.com>
References: <e5ad9eb2-2c5a-4a6b-859b-1ae31c10a563@googlegroups.com>
	<58a18165-31ef-43a6-9f54-9cfa604058d9@googlegroups.com>
	<CANscxGiPgq5_Gu0jmuM-P9q7nqu2BLcN+aAzeUWpDa1-mqu...@mail.gmail.com>
	<CALKyTE77e=fxQ2efcNPFkaOu_9OA4cFK2T2xdNr3pVLqu15...@mail.gmail.com>
	<CANscxGi0Ud0qnjcHvCWxH6GpEJuPqt5NU_JjW21fj4jV6Sn...@mail.gmail.com>
	<9f94a296-33f8-49eb-a9a5-f48095f15639@googlegroups.com>
Date: Wed, 10 Oct 2012 08:05:00 +0700
Message-ID: <CANscxGjQ68DFSKGUbYUczGF65kZz26=Kn=ZT_m1AEbvvk_K...@mail.gmail.com>
Subject: Re: [mongodb-user] Re: Job Schedule in Mongodb
From: Tom Vo <tom...@nexcel.vn>
To: mongodb-user@googlegroups.com
Content-Type: multipart/alternative; boundary=485b397dd21148458404cbaa0b40
X-Gm-Message-State: ALoCoQlqrL5I/xAEWfZa+xRWfreCYGmLc6SJSSNta1mSaEscvCqZcfheKCKIkObPR34ZgTMDV4m+

--485b397dd21148458404cbaa0b40
Content-Type: text/plain; charset=ISO-8859-1

Dear William
Thank you again for your kindly support.
Have a great day.

On Wed, Oct 10, 2012 at 3:58 AM, William Zola <william.z...@10gen.com>wrote:

>
> Hi Tom!
>
> To answer your questions:
>
> 1) The JavaScript engine does not take a read lock or a write lock.  There
> is a separate JavaScript lock.  You can have multiple readers or writers
> while a JavaScript thread is executing, but you cannot have two threads
> using JavaScript running at the same time.
>
> This is not a limitation of MongoDB.  This is a limitation of the
> SpiderMonkey JavaScript engine that MongoDB uses.
>
> Ref:
>  -
> https://github.com/mongodb/mongo/blob/master/src/mongo/scripting/engine_spidermonkey.cpp#L60
>
> If your JavaScript code reads or writes to the database, then -- and only
> then -- will it take a read lock or write lock, as necessary.
>
> 2) If you need to run regular scheduled jobs, then running them with Task
> Scheduler is a good way to do it.
>
> Let me know if you have further questions.  Have a great day!
>
>  -William
>
> On Thursday, October 4, 2012 2:12:33 AM UTC-7, Tom Vo wrote:
>
>> Hi Wiliam
>>
>> I need summary data from some collections and insert to other
>> collection. I setup Mongodb on Windows Server 2008 and used to Task
>> Schedule to run it.
>>
>>
>> On Thu, Oct 4, 2012 at 3:58 PM, Sam Millman <sam.m...@gmail.com> wrote:
>>
>>> Server-side execution will lock yes.
>>>
>>> I am unsure why you need to run a file in the mongo client application
>>> from your own server side application.
>>>
>>> Why can you not run this from your application directly?
>>>
>>>
>>> On 4 October 2012 03:45, Tom Vo <tom...@nexcel.vn> wrote:
>>>
>>>> Hi William
>>>> 1) As your guide, I should not use Stored JavaScript Procedures on
>>>> MongoDB. I have to execute JavaScript file on Mongo Client.
>>>>
>>>> 2) You said that the JavaScript engine is single-threaded. That's
>>>> mean MongoDB will be write locked when this script have not been finished.
>>>> Could you give me document introduce about them?
>>>>
>>>> http://www.mongodb.org/**display/DOCS/Server-side+Code+**Execution<http://www.mongodb.org/display/DOCS/Server-side+Code+Execution>
>>>>
>>>> Thank you for your reply and kindly supports.
>>>>
>>>> On Wed, Oct 3, 2012 at 11:58 PM, William Zola <willia...@10gen.com>wrote:
>>>>
>>>>>
>>>>>
>>>>> Hi Tom!
>>>>>
>>>>> 1) You should avoid using MongoDB stored JavaScript procedures if you
>>>>> possibly can.  The JavaScript engine is single-threaded.  If you run
>>>>> critical processes using the JavaScript stored procedures you are likely to
>>>>> have performance problems.
>>>>>
>>>>> 2) MongoDB currently does not have any ability to schedule any tasks
>>>>> to run.  There is an existing SERVER ticket with a request to add this
>>>>> functionality.  You can follow this ticket and vote it up here:
>>>>> https://jira.mongodb.org/**browse/SERVER-2573<https://jira.mongodb.org/browse/SERVER-2573>
>>>>>
>>>>> 3) If you want to schedule a task to run in MongoDB, the best way to
>>>>> do this is with the operating system scheduler.  For example, 'cron' on
>>>>> Unix/Linux.
>>>>>
>>>>> Have a great day!
>>>>>
>>>>>  -William
>>>>>
>>>>>
>>>>> On Tuesday, October 2, 2012 7:43:52 PM UTC-7, Tom Vo wrote:
>>>>>>
>>>>>> Dear all
>>>>>> Mongodb have support JS function like store procedure, function in
>>>>>> SQL Server. Does Mongodb have to support Job Schedule? How do you do on it?
>>>>>>
>>>>>> Thanks and Regards.
>>>>>>
>>>>>  --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "mongodb-user" group.
>>>>> To post to this group, send email to mongod...@googlegroups.com
>>>>>
>>>>> To unsubscribe from this group, send email to
>>>>> mongodb-user...@**googlegroups.com
>>>>>
>>>>> See also the IRC channel -- freenode.net#mongodb
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Thanks and Best Regards
>>>> ------------------------------**------------------------------**
>>>> ------------------------------**-------------------
>>>> *Tom Vo*
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "mongodb-user" group.
>>>> To post to this group, send email to mongod...@googlegroups.com
>>>>
>>>> To unsubscribe from this group, send email to
>>>> mongodb-user...@**googlegroups.com
>>>>
>>>> See also the IRC channel -- freenode.net#mongodb
>>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "mongodb-user" group.
>>> To post to this group, send email to mongod...@googlegroups.com
>>>
>>> To unsubscribe from this group, send email to
>>> mongodb-user...@**googlegroups.com
>>>
>>> See also the IRC channel -- freenode.net#mongodb
>>>
>>
>>
>>
>> --
>>
>> Thanks and Best Regards
>> ------------------------------**------------------------------**
>> ------------------------------**-------------------
>> *TOM*
>>
>  --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongodb-user@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user+unsubscribe@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb
>



-- 

Thanks and Best Regards
-------------------------------------------------------------------------------------------------------------
*TOM Vo*

--485b397dd21148458404cbaa0b40
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Dear William<div>Thank you again for your kindly support.</div><div>Have a =
great day.<br><br><div class=3D"gmail_quote">On Wed, Oct 10, 2012 at 3:58 A=
M, William Zola <span dir=3D"ltr">&lt;<a href=3D"mailto:william.zola@10gen.=
com" target=3D"_blank">william.z...@10gen.com</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><br>Hi Tom!<br><br>To answer your questions:=
<br><br>1) The JavaScript engine does not take a read lock or a write lock.=
=A0 There is a separate JavaScript lock.=A0 You can have multiple readers o=
r writers while a JavaScript thread is executing, but you cannot have two t=
hreads using JavaScript running at the same time.<br>
<br>This is not a limitation of MongoDB.=A0 This is a limitation of the Spi=
derMonkey JavaScript engine that MongoDB uses.<br><br>Ref: <br>=A0- <a href=
=3D"https://github.com/mongodb/mongo/blob/master/src/mongo/scripting/engine=
_spidermonkey.cpp#L60" target=3D"_blank">https://github.com/mongodb/mongo/b=
lob/master/src/mongo/scripting/engine_spidermonkey.cpp#L60</a><br>
<br>If your JavaScript code reads or writes to the database, then -- and on=
ly then -- will it take a read lock or write lock, as necessary. <br><br>2)=
 If you need to run regular scheduled jobs, then running them with Task Sch=
eduler is a good way to do it.<br>
<br>Let me know if you have further questions.=A0 Have a great day!<br><br>=
=A0-William <br><div class=3D"im"><br>On Thursday, October 4, 2012 2:12:33 =
AM UTC-7, Tom Vo wrote:</div><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Wiliam<div><br></div><div><div class=3D"im">I need summary data from som=
e collections and insert to other collection.=A0I setup Mongodb on Windows =
Server 2008 and used to Task Schedule to run it.<div><br></div></div><div><=
br>
<div class=3D"gmail_quote"><div class=3D"im">
On Thu, Oct 4, 2012 at 3:58 PM, Sam Millman <span dir=3D"ltr">&lt;<a>sam.m.=
....@gmail.com</a>&gt;</span> wrote:<br></div><blockquote class=3D"gmail_quot=
e" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">=
<div class=3D"im">

Server-side execution will lock yes.<br><br>I am unsure why you need to run=
 a file in the mongo client application from your own server side applicati=
on.<br><br>Why can you not run this from your application directly?</div>
<div>
<div><br><br>
<div class=3D"gmail_quote"><div class=3D"im">On 4 October 2012 03:45, Tom V=
o <span dir=3D"ltr">&lt;<a>tom...@nexcel.vn</a>&gt;</span> wrote:<br></div>=
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
<div class=3D"im">

Hi William<div>1) As your guide, I should not use Stored JavaScript Procedu=
res on MongoDB. I have to execute JavaScript file on Mongo Client.=A0</div>=
<div><br></div><div>2) You said that the JavaScript engine is single-thread=
ed. That&#39;s mean=A0MongoDB=A0will be write locked when this script have =
not been finished. Could you give me document introduce about them?=A0</div=
>



<div><br></div><div><a href=3D"http://www.mongodb.org/display/DOCS/Server-s=
ide+Code+Execution" target=3D"_blank">http://www.mongodb.org/<u></u>display=
/DOCS/Server-side+Code+<u></u>Execution</a><br><br></div><div>Thank you for=
 your reply and kindly supports.</div>



</div><div><div><div><br><div class=3D"gmail_quote"><div class=3D"im">On We=
d, Oct 3, 2012 at 11:58 PM, William Zola <span dir=3D"ltr">&lt;<a>willia...=
@10gen.com</a>&gt;</span> wrote:<br>
</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-l=
eft:1px #ccc solid;padding-left:1ex"><div class=3D"im">
<br><br>Hi Tom!<br><br>1) You should avoid using MongoDB stored JavaScript =
procedures if you possibly can.=A0 The JavaScript engine is single-threaded=
.=A0 If you run critical processes using the JavaScript stored procedures y=
ou are likely to have performance problems.<br>



<br>2) MongoDB currently does not have any ability to schedule any tasks to=
 run.=A0 There is an existing SERVER ticket with a request to add this func=
tionality.=A0 You can follow this ticket and vote it up here: <a href=3D"ht=
tps://jira.mongodb.org/browse/SERVER-2573" target=3D"_blank">https://jira.m=
ongodb.org/<u></u>browse/SERVER-2573</a><br>



<br>3) If you want to schedule a task to run in MongoDB, the best way to do=
 this is with the operating system scheduler.=A0 For example, &#39;cron&#39=
; on Unix/Linux.<br><br>Have a great day!<span><font color=3D"#888888"><br>



<br>=A0-William <br></font></span></div><div><div><div class=3D"im"><br><br=
>On Tuesday, October 2, 2012 7:43:52 PM UTC-7, Tom Vo wrote:<blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc=
 solid;padding-left:1ex">



Dear all<div>Mongodb have support JS function like store procedure, functio=
n in SQL Server. Does Mongodb have to support Job Schedule? How do you do o=
n it?</div><div><br></div><div>Thanks and Regards.</div></blockquote>

<p></p>

-- <br>
You received this message because you are subscribed to the Google<br>
Groups &quot;mongodb-user&quot; group.<br></div>
To post to this group, send email to <a>mongod...@googlegroups.com</a><div =
class=3D"im"><br>
To unsubscribe from this group, send email to<br>
</div><a>mongodb-user...@<u></u>googlegroups.com</a><div class=3D"im"><br>
See also the IRC channel -- <a href=3D"http://freenode.net#mongodb" target=
=3D"_blank">freenode.net#mongodb</a><br>
</div></div></div></blockquote></div><br><br clear=3D"all"><div><br></div><=
/div></div><div class=3D"im"><span><font color=3D"#888888">-- <br><br>Thank=
s and Best Regards<br>------------------------------<u></u>----------------=
--------------<u></u>------------------------------<u></u>-----------------=
--<br>


<b>Tom Vo</b><br>

</font></span></div></div><div><div><div class=3D"im">

<p></p>

-- <br>
You received this message because you are subscribed to the Google<br>
Groups &quot;mongodb-user&quot; group.<br></div>
To post to this group, send email to <a>mongod...@googlegroups.com</a><div =
class=3D"im"><br>
To unsubscribe from this group, send email to<br>
</div><a>mongodb-user...@<u></u>googlegroups.com</a><div class=3D"im"><br>
See also the IRC channel -- <a href=3D"http://freenode.net#mongodb" target=
=3D"_blank">freenode.net#mongodb</a><br>
</div></div></div></blockquote></div><div class=3D"im"><br>

<p></p>

-- <br>
You received this message because you are subscribed to the Google<br>
Groups &quot;mongodb-user&quot; group.<br></div>
To post to this group, send email to <a>mongod...@googlegroups.com</a><div =
class=3D"im"><br>
To unsubscribe from this group, send email to<br>
</div><a>mongodb-user...@<u></u>googlegroups.com</a><div class=3D"im"><br>
See also the IRC channel -- <a href=3D"http://freenode.net#mongodb" target=
=3D"_blank">freenode.net#mongodb</a><br>
</div></div></div></blockquote></div><div class=3D"im"><br><br clear=3D"all=
"><div><br></div>-- <br><br>Thanks and Best Regards<br>--------------------=
----------<u></u>------------------------------<u></u>---------------------=
---------<u></u>-------------------<br>
<b>TOM</b><br>

</div></div></div>
</blockquote><div class=3D"HOEnZb"><div class=3D"h5">

<p></p>

-- <br>
You received this message because you are subscribed to the Google<br>
Groups &quot;mongodb-user&quot; group.<br>
To post to this group, send email to <a href=3D"mailto:mongodb-user@googleg=
roups.com" target=3D"_blank">mongodb-user@googlegroups.com</a><br>
To unsubscribe from this group, send email to<br>
<a href=3D"mailto:mongodb-user%2Bunsubscribe@googlegroups.com" target=3D"_b=
lank">mongodb-user+unsubscribe@googlegroups.com</a><br>
See also the IRC channel -- <a href=3D"http://freenode.net#mongodb" target=
=3D"_blank">freenode.net#mongodb</a><br>
</div></div></blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>=
<br>Thanks and Best Regards<br>--------------------------------------------=
-----------------------------------------------------------------<br><i><b>=
<span style=3D"color:rgb(0,0,153)">TOM Vo</span></b></i><br>
<br>
</div>

--485b397dd21148458404cbaa0b40--