persistence

In javascript, how can I uniquely identify one browser window from another which are under the same cookiedbased sessionId

和自甴很熟 提交于 2019-11-26 15:38:01
问题 The users of my web application may have more than one browser window open and pointed to the same page. I would like the state of certain things in the page (loaded via ajax) to be retained across postbacks. I can either store in a cookie or on my server. Either way, I can't think of how I can distinguish each window. For example, say user Bob has two browser windows open to the ListOfSomething page. Each list has a LoadedPageNumber attribute which I need to persist. Otherwise users always

alternative to memcached that can persist to disk

眉间皱痕 提交于 2019-11-26 15:18:17
问题 I am currently using memcached with my java app, and overall it's working great. The features of memcached that are most important to me are: it's fast, since reads and writes are in-memory and don't touch the disk it's just a key/value store (since that's all my app needs) it's distributed it uses memory efficiently by having each object live on exactly one server it doesn't assume that the objects are from a database (since my objects are not database objects) However, there is one thing

Making data persistent in android

北城余情 提交于 2019-11-26 14:07:58
In my application,there are some application specific settings, which should be available to me , next time when my application starts up. In other words i want the data to be available across the sessions of an application cycle. Can this be achieved without using database(sqlite). Pentium10 Many applications may provide a way to capture user preferences on the settings of a specific application or an activity. For supporting this, Android provides a simple set of APIs. Preferences are typically name value pairs. They can be stored as “Shared Preferences” across various activities in an

When should I use the various storage mechanisms in iOS?

℡╲_俬逩灬. 提交于 2019-11-26 14:01:56
问题 I thought this would be covered already, but my search returned nothing of relevance. I am aware that there is NSUserDefaults, Core Data, object archiving, raw SQLite, plists, and of course, storage by web servers. What is unclear and somewhat hazy to a beginner is when to employ each of these various tools. The usages of web servers vs Core Data is obvious, but what about NSUserDefaults vs plists? Core Data vs object archiving? A simple breakdown of use cases would really help me understand

Is it possible to remove child from collection and resolve issues on SaveChanges?

主宰稳场 提交于 2019-11-26 12:55:51
问题 We are using Entity Framework Code First with Foreign Key relationships. We investigating on ways on handling removing objects from an entities ICollection in our application. When we have an entity with child relationships we can add objects directly to their ICollection using Add method. Now when you use remove you get the error System.InvalidOperationException occurred Message=The operation failed: The relationship could not be changed because one or more of the foreign-key properties is

Are there any Java VMs which can save their state to a file and then reload that state?

六眼飞鱼酱① 提交于 2019-11-26 12:44:19
问题 Are there any Java VMs which can save their state to a file and then reload that state? If so, which ones? 回答1: Another option, which may or may not be relevant in your case, is to run the JVM (any JVM) inside a virtual machine. Most virtual machines offer the option to store and resume state, so you should be able to restart your PC, fire up the VM when it comes back up and have the Java process pick up from where it was. I use VMWare Player for testing on IE at work, and this works as noted

Generating a globally unique identifier in Java

泄露秘密 提交于 2019-11-26 12:26:01
问题 Summary: I\'m developing a persistent Java web application, and I need to make sure that all resources I persist have globally unique identifiers to prevent duplicates. The Fine Print: I\'m not using an RDBMS, so I don\'t have any fancy sequence generators (such as the one provided by Oracle) I\'d like it to be fast, preferably all in memory - I\'d rather not have to open up a file and increment some value It needs to be thread safe (I\'m anticipating that only one JVM at a time will need to

Converting from String to custom Object for Spring MVC form Data binding?

时光总嘲笑我的痴心妄想 提交于 2019-11-26 12:23:17
问题 I am using Spring MVC\'s SimpleFormController in conjunction with Spring MVC\'s form JTL to create a form to edit a Generic object. On my form I have a drop down where the user can specify a server via a drop down. <form:form commandName=\"generic\"> <form:select path=\"server\"> <form:options items=\"${servers}\" itemValue=\"id\" itemLabel=\"name\"/> </form:select> </form:form> Servers here is propagated by a database call for all available servers. server is a Server ORM pojo, that is a sub

Solve Hibernate Lazy-Init issue with hibernate.enable_lazy_load_no_trans

杀马特。学长 韩版系。学妹 提交于 2019-11-26 11:40:25
I have been suffering from infamous hibernate exception org.hibernate.LazyInitializationException: could not initialize proxy - no Session Now the community is cheering over <property name="hibernate.enable_lazy_load_no_trans" value="true"/> saying it solves the problem but USE IT WITH CAUTION . What they mean by use it with caution? What this property actually does? Please give me any insights. Thanks in advance. uaiHebert The problem with this approach is that you can have the N+1 effect. Imagine that you have the following entity: public class Person{ @OneToMany // default to lazy private

POCO&#39;s, behavior and Peristance Igorance

我们两清 提交于 2019-11-26 11:35:57
问题 From what I have read POCO classes should be persistence ignorant and should not contain references to repositories. Q1. Given the above, how would I populate the QuestionBlocks collection? I have read that POCO\'s should contain behavior so you don\'t end of with an anemic model, so I\'m kind of confused as how one is supposed to do that without persistence. If that\'s the case then what kind of behavior would you put in a POCO? Ex: public class Survey { public int SurveyId { get; set; }