Question: I'm using the simpleImageCheck plugin and for some reason, the form submits twice.

Below is my javascript:

```
<script type="text/javascript" language="javascript">
$(function() {
$('#pin_candle').simpleImageCheck({
    image: '/images/candle.png',
    imageChecked: '/images/one.png'
  })
$('#pin_rose').simpleImageCheck({
    image: '/images/rose.png',
    imageChecked: '/images/one.png'
  })
});
</script>

```

Here is my rails form: 

```
<%= form_for([@posts, @pin], :remote => true, :html => { :id => 'pinform' }) do |f| %>

  <%= f.check_box :candle, :onChange => "this.form.submit_button.click();" %>

  <%= f.check_box :rose, :onChange => "this.form.submit_button.click();" %>

  <%= f.submit :id => 'submit_button', :style => 'display: none;' %>
<% end %>

```

I need to use this.form.submit\_button.click(); because when I just use the standard this.form.submit(); it submits in html, not js, so rails won't let me do an ajax call.

The other problem is if I disable the form after submitting, I have other checkboxes then the other checkbox doesn't work. 

Any ideas?

Is there a way to stop the double-submitting?

Thank you.

Answer: 
> 
> Can I force a serial NSOperationQueue to execute on a single thread?
>  Or do I have to create my own simple queuing mechanism for that?
> 
> 
> 

You shouldn't need to do either of those. What Core Data really requires is that you don't have two pieces of code making changes to a managed object context *at the same time*. There's even a note on this at the very beginning of [Concurrency with Core Data](http://developer.apple.com/library/ios/#documentation/cocoa/conceptual/coredata/Articles/cdConcurrency.html):

> 
> **Note:** You can use threads, serial operation queues, or dispatch queues for concurrency. 
>  For the sake of conciseness, this article uses “thread” throughout to refer to any of these.
> 
> 
> 

What's really required is that you serialize operations on a given context. That happens naturally if you use a single thread, but NSOperationQueue also serializes its operations if you set `maxConcurrentOperationCount` to 1, so you don't have to worry about ensuring that all operations take place on the same thread.
Apple decided to bind managed objects to real Threads.. it isnt that safe anymore to access a context on different threads - a context without any objects MIGHT be safe but its objects are not