search for: optimistic

Displaying 20 results from an estimated 995 matches for "optimistic".

2006 Apr 11
1
Implementing Optimistic Offline Lock - How ?
I understand that ActiveRecord supports the "optimistic offline lock"-pattern through magic fields (created_at, updated_at). However, a scaffolded CRUD-Controller doesn''t generate the necessary code to support this feature (the model state gets lost between two action calls). What is the best practice to prevent users from overwriting...
2009 Dec 17
2
RFC: conflict_warnings plugin
Greetings, I was hoping to get some feedback on a plugin I wrote. The plugin is called conflict_warnings and is currently available from my github repository at http://github.com/EmFi/conflict_warnings The purpose of the plugin is to provide a simple methods of preventing data inconsistencies that could arise from multiple users interacting with the same resource. Under basic operation a
2010 Jun 08
1
[PATCH] Fix optimistic locking during vm migration
.../src/db-omatic/db_omatic.rb index da11bfa..79f29d2 100755 --- a/src/db-omatic/db_omatic.rb +++ b/src/db-omatic/db_omatic.rb @@ -195,6 +195,9 @@ class DbOmatic < Qmf::ConsoleHandler end @logger.info "Updating VM #{domain['name']} to state #{state}" + # Optimistic locking often fails for this operation + # See http://api.rubyonrails.org/classes/ActiveRecord/Locking/Pessimistic.html#M001320 + vm.lock! if state == Vm::STATE_STOPPED @logger.info "VM has moved to stopped, clearing VM attributes." -- 1.7.0.4
2006 May 09
7
When to use optimistic locking?
Hi All, I''m having some trouble deciding when and how to implement optimistic locking. Let''s say I have a multiuser Rails app, and let''s say it stores, among other things "vital" customer information. The standard methods created by the Rails generate scaffold script look like this: def edit @customer = Customer.find(params[:id])...
2009 May 19
4
proper way to ensure atomic model changes
Hi! Say we have a rails active-record-based model called "instance" which can have different states - STOPPED, RUNNING, STARTING_UP, SHUTTING_DOWN, etc... There is a method #start which changes the instance state to STARTING_UP only if it is STOPPED. def start if self.state == STOPPED self.state = STARTING_UP self.save ... end end As you understand if we have multiple
2008 Aug 22
0
[LLVMdev] Dependence Analysis [was: Flow-Sensitive AA]
...it would be bad to penalize them for this corner case. In such a situation, I think you just have to support both choices, but choose the default as sensibly as possible. I discussed this with Matthieu and this is what we came up with: 1. (Eventually) Support both choices: conservative or optimistic. Conservative means you assume that index arithmetic can wrap around; optimistic assumes it cannot. What I think you've implemented is the optimistic case. 2. Have a default choice but give the programmer an option to force this on or off. 3. (Matthieu's idea) Default to optimis...
2012 Jun 15
1
help in sentDetect() fuction
hello, I am using the following code >s<-"I am very happy, excited, and optimistic.I am very scared, annoyed, and irritated.Iraq?s political crisis entered its second week one step closer to the potential.dissolution of the government, with a call for elections by a vital coalition partner and a suicide attack that extended the spate of violence. that has followed the withdrawal....
2006 Jan 04
2
Rename lock_version field?
Hi, Is there a way to tell Rails that the magic field name for optimistic database locking is not lock_version? I have a legacy database where the optimistic locking field is named "version". Thanks, Phil -- Posted via http://www.ruby-forum.com/.
2013 Feb 26
0
Feedback Needed: Optimistic Locking Destroy Bug
Need feedback on what I think is a bug in AR related to destroying models with optimistic locking. Please check this PR for more information: https://github.com/rails/rails/pull/9448 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rub...
2007 Mar 25
1
Optimistic locking and update_attributes: not working?
Hi all, I''ve searched the forumns, but I can''t seem to find an answer to this one. I''m having trouble getting optimistic locking (OL) to work in my app, even though all of the pieces are there: * table has lock_version column, with default of 0 (zero) * lock_version column is being incremented by the first update (but the second doesn''t catch it) * I''m trapping for ActiveRecord::StaleObjectError, b...
2014 Jul 08
1
arguments to .Call(), .External should be read-only?
...utine called via .Call() or .External() should considered read-only. section 5.2, "Interface functions .C and .Fortran", says ---- However, when character vectors are used other than in a read-only way, the .Call interface is much to be preferred. ---- which sort of implies (if one reads optimistically) that using .Call() (by extension, again optimistically, .External()) one could treat *character* vectors (and, again, optimistically, numeric, etc., vectors) in a non-read-only way. on the other (pessimistic) hand, section 5.9, "Handling R objects in C", says ---- Neither .Call nor...
2018 Aug 23
2
[RFC] "Properly" Derive Function/Argument/Parameter Attributes
...* [1,3], I would like to propose a "proper" organization***. Why? Because we do not derive nearly as many attributes as we could****, while we do maintain various (separate and diffently organized) "data-flow-like analyses" to do so. What else? I propose a single optimistic data-flow (fixpoint) loop to perform the deduction (similar to [2,3] but for all propagation forms and not only call sites -> callee). Given that a pessimistic initialization allows to terminate early, we can then also vary the compile time investment. Where is the catch? It will req...
2013 Feb 25
7
Optimistic Locking Enhancements: Gem or Core?
I''m working on an app that makes use of rails'' optimistic locking feature and seeing some possibilities for improvements. It seems a bit tedious to have to add :lock_version to forms wherever the model is used. You also have to "hack" around rails'' UJS feature to add it as a URL parameter when using remote: true, method: [:put, :p...
2009 Aug 10
1
[PATCH server] Fixed db-omatic so it doesn't die due to an unhandled ActiveRecord::StaleObjectError exception.
..._omatic.rb @@ -160,7 +160,9 @@ class DbOmatic < Qpid::Qmf::Console end begin - # find open vm host history for this vm, + # find open vm host history for this vm + # NOTE: db-omatic is currently the only user for VmHostHistory, so + # using optimistic locking is fine. Someday this might need changing. history = VmHostHistory.find(:first, :conditions => ["vm_id = ? AND time_ended is NULL", vm.id]) if state == Vm::STATE_RUNNING @@ -215,7 +217,14 @@ class DbOmatic < Qpid::Qmf::Console end...
2008 Aug 22
5
[LLVMdev] Dependence Analysis [was: Flow-Sensitive AA]
>However, there is one issue I have ignored - possibility of overflow in >the index expression. Suppose, we have such a loop: > for (i8 i = 0; i != 200; ++i) { > A[2 * i + 5] = ... > ... = A[2 * i + 3] > } >If both index expressions are evaluated in 8-bit arithmetic, >then the dependence equation should be solved in modular arithmetic: > 2 * i + 5 == 2 * (i +
2009 Aug 10
0
[PATCH server] Fixed db-omatic so it doesn't die due to unhandled exceptions related to saving db objects in update_host_state and update_domain_state.
The underlying issue has to do with optimistic locking for active record, and contention between db-omatic and task-omatic. That still needs to be fixed, especially since contention issues might get worse when the two daemons are made multithreaded. --- src/db-omatic/db_omatic.rb | 22 +++++++++++++++++++--- 1 files changed, 19 insertions(+)...
2006 May 17
6
ActiveRecord#to_param
Hello, to implement some some kind of optimistic locking, I want to build a view, where an object is displayed together with a link containing the data of the displayed object. My first try looked something like <%= object.object_discription %> <%= link_to "action", :action => "take_action", :data => object %...
2000 Nov 18
5
Sample still has horrorible distortions... anyone know why?
Hi, I am subscribed to this list, and have learned a lot just from the discussions i see although i don't reply to the msgs, simply coz i'm no big deal programmer. I feel, though, that as i'm really optimistic about vorbis and want it to grow and start to have more and more people using it, i feel that i should warn you about a bug the encoder have (i'm sure monty receives loads of known bugs reports). I have posted a msg on the LAME dev board about 2 months or so, and gave the link to the sample. I...
2005 May 25
2
[LLVMdev] llc -march=ia64 support
...vm. A understood this ia64 support will be worked on soon. First week of july there will be a pypy-sprint in Goteborg (Sweden) where the focus will be on translating Python code to other languages like LLVM,C,Lisp,Java,etc.. Is there a change llc will support ia64 in about 4 weeks time or am I to optimistic? best regards Eric van Riet Paap
2009 Nov 24
6
[LLVMdev] New 8bit micro controller back-end
...Korobeynikov wrote: > Hello > > > It is a RISC with around 60 instructions like a 80c51 instruction set > > (without mul/div) and with Direct or indirect memory acces. > > My estimate is something like a man-week for a person, who knows what to do > :) That's pretty optimistic, even for someone who knows what to do. The learning curve for TableGen is quite steep. I would budget at least a year for everything; learning TableGen, writing patterns, custom lowering, testing, etc. And that's for a relatively simple, orthogonal ISA. Of course this happens iteratively....