Take the 2-minute tour ×
English Language & Usage Stack Exchange is a question and answer site for linguists, etymologists, and serious English language enthusiasts. It's 100% free, no registration required.

Which of the following is correct?

  1. The program persists the data in the database.
  2. The program persists the data to the database.

In feels a little more natural to me, but I have no particular basis for that.

share|improve this question
2  
Today I learned that persist can be transitive. Interesting. (In probably sounds more natural because that's what you'd normally use with the intransitive verb, as in "I persist in my view". You wouldn't say "I persist to my view".) –  RegDwigнt Nov 17 '10 at 13:21
    
what is transitive and why would you normally use in with the transitive verb? –  Anderson Silva Nov 17 '10 at 13:28
    
@vehomzzz: a transitive verb is one which acts on something (technically, it has an object). See en.wikipedia.org/wiki/Transitive_verb - or ask that as a question on this site! –  Steve Melnikoff Nov 17 '10 at 13:38
add comment

3 Answers

up vote 1 down vote accepted

The program persists the data in the database.

Here is what I would say in general:

  • save the object in the database
  • update the object in the database
  • persist the object in the database (same as save or update)
  • load the object from the database
  • write the object to a file
  • read the object from a file
share|improve this answer
add comment

I would have choosen both. I mean "Into" :-)

share|improve this answer
    
as the database is a container, you place things into it to persist them. –  Dan D. Feb 15 '11 at 20:18
add comment

Despite RegDwight's comment that persist can be transitive with a direct object, which I didn't know either, I'd suggest that such usage is unusual.

With regard to the actual question, the use of persist suggests that the data was in the database before, and that the program doesn't change that; hence in should be used here.

So I would write:

The program causes the data to persist in the database.

EDIT: In light of the comments below, note this answer applies to persist in its normal, non-programming, contexts. For its use in a programming context, in is still correct, but the verb can be used transitively, as in the question.

share|improve this answer
    
Yeah, Merriam-Webster and Co. don't list it as transitive, but Wiktionary actually does, hence my comment. –  RegDwigнt Nov 17 '10 at 13:35
    
@RegDwight: given that the example quoted is quite recent, I wonder if this usage is a new one which hasn't caught on (yet). –  Steve Melnikoff Nov 17 '10 at 13:41
2  
@Steve, @RegDwight: it can be transitive because you can say "persist an object" the same way that you can say "save/load/update/merge an object". It's a technical definition of persist that is particular to programming. Apparently, most dictionaries don't bring that definition of "persist" yet. –  b.roth Nov 17 '10 at 13:53
1  
@RegDwight: Just a note on usage, persist here does not imply that the data was already there. In fact I'd go as far as saying that usually it is not already present. Persisting is the action of saving the data, I suppose. –  Joe Kearney Nov 17 '10 at 14:29
1  
Well, you learn something new every day :-) –  Steve Melnikoff Nov 17 '10 at 14:35
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.