persistence

What gives Smalltalk the ability to do image persistence, and why can't languages like Ruby/Python serialize themselves?

Deadly 提交于 2020-01-22 10:35:08
问题 In smalltalk, you're able to save the state of the world into an image file. I assume this has to do with Smalltalk's ability to "serialize" itself -- that is, objects can produce their own source code. 1) Is this an accurate understanding? 2) What is the challenge in adding this ability to modern languages (non-lisp, obviously)? 3) Is "serialization" the right word? What's the correct jargon? 回答1: It's much simpler than "serializing". A Smalltalk image is simply a snapshot of the object

Elisp: How to save data in a file?

☆樱花仙子☆ 提交于 2020-01-22 07:14:20
问题 I want to save data to a file in my elisp program. I have a multi-dimensional list that I want to save to a file, so I can restore it the next time my program runs. What's the easiest / best way to do this? I realise, of course, that I can simply write my data to a buffer in a custom format and then save the buffer, but then I'd have to write a function to parse that data format when I want to restore it. I'd rather not have to do that. In Python, there's the Pickle module that lets you "dump

WCF data persistence between sessions

一笑奈何 提交于 2020-01-21 12:55:51
问题 We are developing a WCF based system. In the process we are trying to lock some data from being modified by more than one users. So we decided to have a data structure that will contain the necessary information for the locking logic to execute (by for example storing the ID of the locked objects) The problem we are having is persisting that data between sessions. Is there anyway we can avoid executing expensive database calls? I am not sure how can we do that in WCF since it can only persist

YAML serialization library for C++?

蹲街弑〆低调 提交于 2020-01-20 18:48:08
问题 YAML seems like a great format for configuration files & data binding persistent objects in human-readable form... Is there a C++ library that handles YAML? Does Boost::Serialization have plans for a YAML option? EDIT: I would prefer an OO library. 回答1: A quick search gave me this: yaml-cpp 回答2: Try the YAML component from the BOOST vault serialization library. EDIT 2014 : A recent development, https://groups.google.com/d/msg/boost-devel-archive/mhT7qIh1nsI/uXAuXFAWrxQJ EDIT 2019 : Didn't try

jpa error uses a non-entity [class ch.printsoft.mailhouse.usermgr.entity.Department] as target entity in the relationship attribute

时光毁灭记忆、已成空白 提交于 2020-01-20 05:32:44
问题 I try to persist my Department and Mandator classes to hsqhldb but it gives this error. Exception Description: [class ch.printsoft.mailhouse.usermgr.entity.Mandator] uses a non-entity [class ch.printsoft.mailhouse.usermgr.entity.Department] as target entity in the relationship attribute [field departments]. at org.eclipse.persistence.exceptions.PersistenceUnitLoadingException.exceptionSearchingForPersistenceResources(PersistenceUnitLoadingException.java:126) at org.eclipse.persistence.jpa

With Python, can I keep a persistent dictionary and modify it?

空扰寡人 提交于 2020-01-20 03:55:19
问题 So, I want to store a dictionary in a persistent file. Is there a way to use regular dictionary methods to add, print, or delete entries from the dictionary in that file? It seems that I would be able to use cPickle to store the dictionary and load it, but I'm not sure where to take it from there. 回答1: If your keys (not necessarily the values) are strings, the shelve standard library module does what you want pretty seamlessly. 回答2: Use JSON Similar to Pete's answer, I like using JSON because

Can't persist symfony collection with double embedded form

◇◆丶佛笑我妖孽 提交于 2020-01-17 07:05:34
问题 I receive the following error when trying to submit my form : An exception occurred while executing 'INSERT INTO UserIngredientSupplier (quantity, cost, createdAt, updatedAt, unitId, organizationId, userIngredientId) VALUES (?, ?, ?, ?, ?, ?, ?)' with params [1000, 4.5, "2014-11-27 22:46:51", "2014-11-27 22:46:51", 4, 2, null]: SQLSTATE[23000]: Integrity constraint violation: 1048 Le champ 'userIngredientId' ne peut être vide (null) I did not forget to put 'by_reference' => false , I did not

Spring Data JPA updates entity when I don't want it to

爷,独闯天下 提交于 2020-01-17 02:13:36
问题 I have a situation where I want to retrieve data, but before it is returned I want to change it without saving/persisting. Here is my rest controller: @RestController @RequestMapping("api/drawing-releases") @CrossOrigin("*") public class DrawingReleaseRestController { @Autowired private DrawingReleaseService service; @RequestMapping(method = RequestMethod.GET, value = "/{id}") @JsonView(View.DrawingReleaseView.class) public ResponseEntity<DrawingRelease> getWithId(@PathVariable int id) throws

How to presist Login credentials and do auto-login in Android

左心房为你撑大大i 提交于 2020-01-16 18:54:19
问题 How can I save userId and Password? I am developing an application which requires to store email id and password, so that the user can directly redirect to his home page if the user already exists. Now Next time when the user logins, he is directed to his home page directly. He should not again type in his userId and pasword. 回答1: You can stream multiple objects to the same file FileOutputStream fStream = openFileOutput(namefile.bin, Context.MODE_PRIVATE) ; ObjectOutputStream oStream = new

Grails Mapping LocalDateTime of Java 8 domain objects to Gorm

让人想犯罪 __ 提交于 2020-01-16 04:50:09
问题 Java 8 gives the java.time API. I am using a grails application, I want to use java.time for properties of my domain classes. I need to map for instance the LocalDateTime to the DATE/DATETIME on GORM which is built on top of Hibernate. How can I persist my mappings? I see a solution, that I can use jadira, and establish static mappings for my attributs. However is there another way? Please any help is appreciated. 回答1: You can use the user type mapping. See the docs. That should remove the