object-persistence

How to correctly stream a TCollection property of a subcomponent, e.g. the Columns property of an embedded TDBGrid

倖福魔咒の 提交于 2019-11-29 14:34:47
I've been trying to boil down to an MCVE some code the author of another q sent me to illustrate a problem with a custom component. The component is simply a TPanel descendant which includes an embedded TDBGrid. My version of its source, and a test project are below. The problem is that if the embedded DBGrid has been created with persistent columns, when its test project is re-opened in the IDE, an exception is raised Error reading TColumn.Grid.Expanded . Property Grid does not exist. Executing the Stream method of the test project shows how this problem arises: For comparison purposes, I

MVC3 multi step form - How to persist model object

不羁岁月 提交于 2019-11-28 23:49:22
I have a multi step form which uses one model object and I need to persist it between the steps. The object gets saved to the database only after the final step. I have seen people suggest using HTML.Serialize but how secure is this option? Also my model object will grow as the user fills up the form which means the hidden form field with serialized data will add up size to my HTML output. Whats the best practice for this kind of situation? I've use the TempData for this purpose. You can store an object (a copy of your model data) in TempData, and use it in the next request. If it is not set

persistent vs immutable data structure

馋奶兔 提交于 2019-11-28 21:17:50
问题 Is there any difference in a persistent and immutable data structure? Wikipedia refers to immutable data structure when discussing persistence but I have a feeling there might be a subtle difference between the two. 回答1: Immutability is an implementation technique. Among other things, it provides persistence , which is an interface. The persistence API is something like: version update(operation o, version v) performs operation o on version v , returning a new version. If the data structure

How to correctly stream a TCollection property of a subcomponent, e.g. the Columns property of an embedded TDBGrid

我与影子孤独终老i 提交于 2019-11-28 08:54:35
问题 I've been trying to boil down to an MCVE some code the author of another q sent me to illustrate a problem with a custom component. The component is simply a TPanel descendant which includes an embedded TDBGrid. My version of its source, and a test project are below. The problem is that if the embedded DBGrid has been created with persistent columns, when its test project is re-opened in the IDE, an exception is raised Error reading TColumn.Grid.Expanded . Property Grid does not exist.

Do I ever need to explicitly flush GORM save calls in grails?

≯℡__Kan透↙ 提交于 2019-11-27 17:31:27
I have a strange situation which appears to indicate a GORM cacheing problem //begin with all book.status's as UNREAD Book.list().each { book.status = Status.READ ; book.save() } println (Book.findAllByStatus (Status.READ)) //will print an empty list println (Book.list().findAll (it.status == Status.READ)) // will print all books I cannot understand why the last two queries could return different results. However if I make the following modification of book.save(flush:true) . Both of the println statements will return all books. I was under the impression that this was not necessary within a

MVC3 multi step form - How to persist model object

时间秒杀一切 提交于 2019-11-27 15:16:37
问题 I have a multi step form which uses one model object and I need to persist it between the steps. The object gets saved to the database only after the final step. I have seen people suggest using HTML.Serialize but how secure is this option? Also my model object will grow as the user fills up the form which means the hidden form field with serialized data will add up size to my HTML output. Whats the best practice for this kind of situation? 回答1: I've use the TempData for this purpose. You can

DTOs vs Serializing Persisted Entities

筅森魡賤 提交于 2019-11-27 04:36:05
问题 I'm curious to know what the community feels on this subject. I've recently come into the question with a NHibernate/WCF scenario(entities persisted at the service layer) and realized I may be going the wrong direction here. My question is plainly, when using a persistent object graph(NHibernate, LINQ to SQL, etc) behind a web service(WCF in this scenario), do you prefer to send those entities over the wire? Or would you create a set of lighter DTO's(sans cyclic references) across? 回答1: DTOs.