persistence

Django database connections pool with psycopg2.pool

Hi folks, I'm trying to implement persistent database connection pool with django. One of the options is to use built in psycopg2.pool code which provide different types of pools (PersistentConnectionPool, ThreadedConnectionPool etc ), but there is no psycopg2 documentation on that topic. So, do anyone done any work in this direction ...

Persistent field in Android service

I need to retain a complex object in my service, so I can reliably come back to it (it holds updates). Initially I coded it just as a class filed in my Service implementation but I'm observing that the updates object is periodically reset to null which tells me that server class itself is recreated. Can someone recommend lightweight reli...

Hibernate one to many using something other than a primary key

I have a class A that has a set of B's. However, these two objects are linked by fields that are NOT the primary key. For B, I can use , but how do I specify that the join should be in A.secondary_column, Not A. table_primary_key_id ? <class table="a"> < id column="table_primary_key_id" > < /id> <property column="secondary...

Combining semacodes and steganography?

This is an idea I have been thinking about, but I do not quite know how to solve it. I would like to know if any solutions like this exists out there, or if you guys have any idea how this could be implemented. Steganography Steganography is basically the art of hiding messages. In modern days we do this digitally by e.g. modifying the...

Best way to implement "Remember Me" check box in WinForms / WPF

I want to add a "Remember Me" check box to the login form of my WPF App. What's the best way to do this? Currently the app logs in via a websevice call that returns an authenticated token that it uses for subsequent calls. Should I simply two-way encrypt and store this token somewhere in the files system? ...

How can I leverage JPA when code is generated?

I have classes for entities like Customer, InternalCustomer, ExternalCustomer (with the appropriate inheritance) generated from an xml schema. I would like to use JPA (suggest specific implementation in your answer if relevant) to persist objects from these classes but I can't annotate them since they are generated and when I change the ...

How can I store a list of references in Perl?

Hi, I would like to create a list of records. I can add one record just fine: my $records = [ { ID => 5342755, NAME => 'Me', } , ]; When I try to add another record, the other records disappear: $records = [ { ID => 1212121, } ]; What is the problem and how can I resolve this? ...

Persisting/caching data between requests - common approach

I'm developing an Asp.net (MVC but this doesn't really matter) application. I have a custom IHttpModule that's responsible for the PostAuthenticateRequest to change user principal & identity. I'm storing UserID and UserName in authentication cookie when user logs-in. I have an IUser (implemented by DAO and Business Objects layer, each w...

Persisting sensitve data in asp.net, odd implementation

For reasons not in scope of this question I have implemented a .net project in an iframe which runs from a classic asp page. The classic asp site persisted a few sensitive values by hitting the db on each page. I have passed there variables as xml to the aspx page, now I need to make these values available on any page of this .net si...

NHibernate Event Listeners Persistence - how does it work?

I decided to implement the event listeners in the latest build of NHibernate to keep track of who is making edits and what those edits are. My question is this - the below does work and I can step through it but what I'm not sure how these changes get saved ... do I need to build an audit table and write a mapping for it to call a save ...

Is it possible to store an NSMutableArray together with all its contents into a file and restore it later from there?

Some kind of serialization available in iPhone OS? Is that practically possible or should I quickly forget about that? I am making a tiny app that stores some inputs in an NSMutableArray. When the user leaves, the inputs should stay alive until he/she returns to continue adding or removing stuff to/from that array. When the app quits, ...

How do I persist data to disk, and both randomly update it, and stream it efficiently back into RAM?

I need to store up to tens or even hundreds of millions of pieces of data on-disk. Each piece of data contains information like: id=23425 browser=firefox ip-address=10.1.1.1 outcome=1.0 New pieces of data may be added at the rate of up-to 1 per millisecond. So its a relatively simple set of key-value pairs, where the values can be s...

How to make sure that App Updates don't override all the user data?

I'm not sure about this: When I use sqlite3 in my app, I ship it with an almost empty database. Over time, the user adds a lot of stuff to it, until he installs an update. For me it looks like an update just replaces the old app. What's the trick that the update will not override all data entered previously by the user? and how about set...

Besides sqlite3, CoreData and NSUserDefaults, what are the most easy to handle data persistance techniques in iPhone OS?

I think that sqlite3 is a little overkill in complexity for my purpose. I have a really tiny app that takes very tiny input from the user. Inputs are floating point values, dates and integers. I'd say even a hardcore user will generate not more than 10 kb of data with that app. The object graph can be described pretty good with an calcu...

Where would NSKeyedArchiver typically store the data on the iPhone?

I try to imagine how that would look like in the iPhone's filesystem. When I archive some stuff, it goes maybe into the documents dir, right? Could I take that file then and send it to a server for backup purposes? ...

JPA with TopLink: No META-INF/persistence.xml was found in classpath

public class LoginTest { public static void main(String[] args) { EntityManagerFactory emf = Persistence.createEntityManagerFactory("IRCBotPU"); EntityManager em = emf.createEntityManager(); em.getTransaction().begin(); Login lg = new Login(); lg.setPassword("password"); lg.setUserName("Rocky"); em.persist...

What would you call a non-persistent data structure that allows persistent operations?

I've got a class that is essentially mutable, but allows for some "persistent-like" operations. For example, I can mutate the object like this (in Python): # create an object with y equal to 3 and z equal to "foobar" x = MyDataStructure(y = 3, z = "foobar") x.y = 4 However, in lieu of doing things this way, there are a couple of met...

Storing a persistent CLLocation

I think I am missing something obvious somewhere. I have a (CLLocation *)lastqueriedlocation defined in the header as a property and synthesized. I want to updated it in locationManager:didUPdateToLocation:fromLocation: - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CL...

Optimal way to persist an object graph to flash on the iPhone

I have an object graph in Objective-C on the iPhone platform that I wish to persist to flash when closing the app. The graph has about 100k-200k objects and contains many loops (by design). I need to be able to read/write this graph as quickly as possible. So far I have tried using NSCoder. This not only struggles with the loops but als...

Store documents in file system instead of database in SharePoint document library

In a SharePoint document library, is there any way to store the documents on the file system instead of the database? ...