11-14-2010 11:09 AM
I'm using persistent object to store some data fields.
how can i create relationship between two classes which they need to sotre details in one object ?
Will it be possible ?
At the same time is it possible to access to application to share a stored data ?
In midlets we can use one recordstore for two applications. Is there any similar way in blackberry ?
Can anybody help me on this ?
Thanks in advance.
11-14-2010 11:29 AM
When you open your persistent object, you'll just open the same location for both apps. While this method works our for you, it's also a security "issue":
PersistentObject rec = PersistentStore.getPersistentObject(PersistentKey);
Leaving the PersistentKey the same between two apps will "share" the data. If you wanted more, you could do Code Signing and sign the two apps with the same key...at least I think...
11-14-2010 12:14 PM
The persistent store stores objects, so you would need to create a class that both applications use. However, IMHO, the persistent store shouldn't really be used as a database. Keep in mind you are messing with a finite amount of memory space...and it's shared...
I guess in short, the Persistent Store is not a database, its a storage mechanism to store entire objects into NVRAM. RMS has similar limitations. Maybe if you described what youre trying to do...