You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by Andy Jefferson <an...@datanucleus.org> on 2008/06/18 11:16:15 UTC

JDO 2.2 : read-only datastore

Something that we've been asked for several times is where a user has a 
datastore that is outside their control and they either don't have permission 
to write to it, or maybe they have permissions but don't want to write to it.

Propose :-
PMF property (with setter/getter)
javax.jdo.option.ReadOnly - values true | false

Behaviour :-
Use of makePersistentXXX(), deletePersistentXXX() will throw JDOUserException.
Use of query.deletePersistentAll() will throw JDOUserException



-- 
Andy  (DataNucleus - http://www.datanucleus.org)

RE: JDO 2.2 : read-only datastore

Posted by Eric Samson <er...@xcalia.com>.
As always in read-only cases, we could ideally have several options:

·         Raise an exception at operation time

·         Raise an exception at commit time

·         Silently ignore the operations (we accept the operation with no exception but we don’t apply it in the datastores)

·         Ignore it but, mention it somewhere (potentially in logs, but logs are not standardized AFAIK)

 

Best Regards,

.::. Eric Samson, CTO Data Services, DataDirect

Mobile: +33 6.03.02.53.41 -  <http://blog.xcalia.com/> Blog Data Access

 

De : Michael Bouschen [mailto:mbo.tech@spree.de] 
Envoyé : mercredi 18 juin 2008 16:19
À : jdo-dev@db.apache.org; JDO Expert Group
Objet : Re: JDO 2.2 : read-only datastore

 

Hi Andy, hi Matthew,

I agree with Matthew that in order to support read only datastores we have to deal with modifications of PCs. I am wondering which operation would result in an exception. How about commit or flush throwing an exception if any modification is about to be flushed to the datastore?

JDOReadOnlyException sounds good to me.

Regards Michael




Why not also require modifications to PCs to throw JDOUserException? Further, the exception could be a new extension of JDOUserException called JDOReadOnlyException. 

Andy Jefferson wrote: 



Something that we've been asked for several times is where a user has a datastore that is outside their control and they either don't have permission to write to it, or maybe they have permissions but don't want to write to it. 

Propose :- 
PMF property (with setter/getter) 
javax.jdo.option.ReadOnly - values true | false 

Behaviour :- 
Use of makePersistentXXX(), deletePersistentXXX() will throw JDOUserException. 
Use of query.deletePersistentAll() will throw JDOUserException 




 

-- 

Michael Bouschen
Prokurist

akquinet tech@spree GmbH
Tempelhofer Ufer 23-24, D-10963 Berlin
Bülowstr. 66, D-10783 Berlin

Fon:   +49 30 235 520-33
Fax:   +49 30 217 520-12
Email: michael.bouschen@akquinet.de
Url:    www.akquinet.de

akquinet tech@spree GmbH, Berlin
Geschäftsführung: Prof. Dr. Christian Roth, Hendrik Saly, Martin Weber
Amtsgericht Berlin-Charlottenburg HRB 86780
USt.-Id. Nr.: DE 225 964 680


Re: JDO 2.2 : read-only datastore

Posted by Michael Bouschen <mb...@spree.de>.
Hi Andy, hi Matthew,

I agree with Matthew that in order to support read only datastores we 
have to deal with modifications of PCs. I am wondering which operation 
would result in an exception. How about commit or flush throwing an 
exception if any modification is about to be flushed to the datastore?

JDOReadOnlyException sounds good to me.

Regards Michael

> Why not also require modifications to PCs to throw JDOUserException? 
> Further, the exception could be a new extension of JDOUserException 
> called JDOReadOnlyException.
>
> Andy Jefferson wrote:
>> Something that we've been asked for several times is where a user has 
>> a datastore that is outside their control and they either don't have 
>> permission to write to it, or maybe they have permissions but don't 
>> want to write to it.
>>
>> Propose :-
>> PMF property (with setter/getter)
>> javax.jdo.option.ReadOnly - values true | false
>>
>> Behaviour :-
>> Use of makePersistentXXX(), deletePersistentXXX() will throw 
>> JDOUserException.
>> Use of query.deletePersistentAll() will throw JDOUserException
>>
>>
>>


-- 
*Michael Bouschen*
*Prokurist*

akquinet tech@spree GmbH
Tempelhofer Ufer 23-24, D-10963 Berlin
Bülowstr. 66, D-10783 Berlin

Fon:   +49 30 235 520-33
Fax:   +49 30 217 520-12
Email: michael.bouschen@akquinet.de
Url:    www.akquinet.de <http://www.akquinet.de>

akquinet tech@spree GmbH, Berlin
Geschäftsführung: Prof. Dr. Christian Roth, Hendrik Saly, Martin Weber
Amtsgericht Berlin-Charlottenburg HRB 86780
USt.-Id. Nr.: DE 225 964 680

Re: JDO 2.2 : read-only datastore

Posted by Matthew Adams <ma...@matthewadams.org>.
Why not also require modifications to PCs to throw JDOUserException? 
Further, the exception could be a new extension of JDOUserException 
called JDOReadOnlyException.

Andy Jefferson wrote:
> Something that we've been asked for several times is where a user has a 
> datastore that is outside their control and they either don't have permission 
> to write to it, or maybe they have permissions but don't want to write to it.
> 
> Propose :-
> PMF property (with setter/getter)
> javax.jdo.option.ReadOnly - values true | false
> 
> Behaviour :-
> Use of makePersistentXXX(), deletePersistentXXX() will throw JDOUserException.
> Use of query.deletePersistentAll() will throw JDOUserException
> 
> 
>