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 (JIRA)" <ji...@apache.org> on 2011/03/04 10:48:36 UTC

[jira] Created: (JDO-678) Ability to set properties on PersistenceManager

Ability to set properties on PersistenceManager
-----------------------------------------------

                 Key: JDO-678
                 URL: https://issues.apache.org/jira/browse/JDO-678
             Project: JDO
          Issue Type: Improvement
          Components: api, specification, tck
            Reporter: Andy Jefferson


It would be desirable to be able to set properties on the PersistenceManager, so as to be able to configure/change behaviour for a PM. Currently the PM is generated with particular configuration (from the PMF) and allows specific options to be set. But what about vendor extensions ? Having a general setProperty/getProperty/getSupportedProperties would be useful, and could also encompass the existing detachAllOnCommit, IgnoreCache, etc settings.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (JDO-678) Ability to set properties on PersistenceManager

Posted by "Michael Bouschen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Bouschen updated JDO-678:
---------------------------------

    Affects Version/s: JDO 3
        Fix Version/s: JDO TCK challenge fixes
                       JDO 3 maintenance release 1
             Assignee: Andy Jefferson

> Ability to set properties on PersistenceManager
> -----------------------------------------------
>
>                 Key: JDO-678
>                 URL: https://issues.apache.org/jira/browse/JDO-678
>             Project: JDO
>          Issue Type: Improvement
>          Components: api, specification, tck
>    Affects Versions: JDO 3
>            Reporter: Andy Jefferson
>            Assignee: Andy Jefferson
>             Fix For: JDO 3 maintenance release 1
>
>         Attachments: jdo-678.patch
>
>
> It would be desirable to be able to set properties on the PersistenceManager, so as to be able to configure/change behaviour for a PM. Currently the PM is generated with particular configuration (from the PMF) and allows specific options to be set. But what about vendor extensions ? Having a general setProperty/getProperty/getSupportedProperties would be useful, and could also encompass the existing detachAllOnCommit, IgnoreCache, etc settings.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (JDO-678) Ability to set properties on PersistenceManager

Posted by "Michael Bouschen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13002977#comment-13002977 ] 

Michael Bouschen commented on JDO-678:
--------------------------------------

The patch looks good. Just one queston: what is the right return type for getProperties? 
The patch uses Map<String, Object> for PM.getProperties, where PMF.getProperties returns java.util.Properties.  

> Ability to set properties on PersistenceManager
> -----------------------------------------------
>
>                 Key: JDO-678
>                 URL: https://issues.apache.org/jira/browse/JDO-678
>             Project: JDO
>          Issue Type: Improvement
>          Components: api, specification, tck
>    Affects Versions: JDO 3
>            Reporter: Andy Jefferson
>            Assignee: Andy Jefferson
>             Fix For: JDO 3 maintenance release 1
>
>         Attachments: jdo-678.patch
>
>
> It would be desirable to be able to set properties on the PersistenceManager, so as to be able to configure/change behaviour for a PM. Currently the PM is generated with particular configuration (from the PMF) and allows specific options to be set. But what about vendor extensions ? Having a general setProperty/getProperty/getSupportedProperties would be useful, and could also encompass the existing detachAllOnCommit, IgnoreCache, etc settings.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (JDO-678) Ability to set properties on PersistenceManager

Posted by "Craig L Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13480074#comment-13480074 ] 

Craig L Russell commented on JDO-678:
-------------------------------------

Specification update:

12.19 Property Management
The operation of a PersistenceManager is partly governed by the settings of various properties, which have been documented in earler sections. These properties are inherited from the PersistenceManagerFactory whence the PersistenceManager was obtained. The properties can be set by methods such as setNontransactionalRead. Some properties are not standardized but are implementation-defined. These non-standard properties can only be set via the setProperty method.
void setProperty(String name, Object value);
Set the property named name to the value value. If a vendor-specific property is not recognized, it is silently ignored. If the value for the property is not supported by the implementation, a JDOUserException is thrown.
Map<String, Object> getProperties();
Return a map of String, Object with the properties and values currently in effect. Changing the values in the map will not affect the properties in the PersistenceManager.
Set<String> getSupportedProperties();
Return a set of properties supported by this PersistenceManager.
                
> Ability to set properties on PersistenceManager
> -----------------------------------------------
>
>                 Key: JDO-678
>                 URL: https://issues.apache.org/jira/browse/JDO-678
>             Project: JDO
>          Issue Type: Improvement
>          Components: api, specification, tck
>    Affects Versions: JDO 3 (3.0)
>            Reporter: Andy Jefferson
>            Assignee: Craig L Russell
>             Fix For: JDO 3 maintenance release 1 (3.1)
>
>         Attachments: jdo-678.patch
>
>
> It would be desirable to be able to set properties on the PersistenceManager, so as to be able to configure/change behaviour for a PM. Currently the PM is generated with particular configuration (from the PMF) and allows specific options to be set. But what about vendor extensions ? Having a general setProperty/getProperty/getSupportedProperties would be useful, and could also encompass the existing detachAllOnCommit, IgnoreCache, etc settings.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (JDO-678) Ability to set properties on PersistenceManager

Posted by "Michael Bouschen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Bouschen updated JDO-678:
---------------------------------

    Fix Version/s:     (was: JDO TCK challenge fixes)

> Ability to set properties on PersistenceManager
> -----------------------------------------------
>
>                 Key: JDO-678
>                 URL: https://issues.apache.org/jira/browse/JDO-678
>             Project: JDO
>          Issue Type: Improvement
>          Components: api, specification, tck
>    Affects Versions: JDO 3
>            Reporter: Andy Jefferson
>            Assignee: Andy Jefferson
>             Fix For: JDO 3 maintenance release 1
>
>         Attachments: jdo-678.patch
>
>
> It would be desirable to be able to set properties on the PersistenceManager, so as to be able to configure/change behaviour for a PM. Currently the PM is generated with particular configuration (from the PMF) and allows specific options to be set. But what about vendor extensions ? Having a general setProperty/getProperty/getSupportedProperties would be useful, and could also encompass the existing detachAllOnCommit, IgnoreCache, etc settings.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (JDO-678) Ability to set properties on PersistenceManager

Posted by "Craig L Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485035#comment-13485035 ] 

Craig L Russell commented on JDO-678:
-------------------------------------

Let's see about making a test case for this.
                
> Ability to set properties on PersistenceManager
> -----------------------------------------------
>
>                 Key: JDO-678
>                 URL: https://issues.apache.org/jira/browse/JDO-678
>             Project: JDO
>          Issue Type: Improvement
>          Components: api, specification, tck
>    Affects Versions: JDO 3 (3.0)
>            Reporter: Andy Jefferson
>            Assignee: Craig L Russell
>             Fix For: JDO 3 maintenance release 1 (3.1)
>
>         Attachments: jdo-678.patch
>
>
> It would be desirable to be able to set properties on the PersistenceManager, so as to be able to configure/change behaviour for a PM. Currently the PM is generated with particular configuration (from the PMF) and allows specific options to be set. But what about vendor extensions ? Having a general setProperty/getProperty/getSupportedProperties would be useful, and could also encompass the existing detachAllOnCommit, IgnoreCache, etc settings.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Assigned: (JDO-678) Ability to set properties on PersistenceManager

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Jefferson reassigned JDO-678:
----------------------------------

    Assignee:     (was: Andy Jefferson)

Patch committed. 

> Ability to set properties on PersistenceManager
> -----------------------------------------------
>
>                 Key: JDO-678
>                 URL: https://issues.apache.org/jira/browse/JDO-678
>             Project: JDO
>          Issue Type: Improvement
>          Components: api, specification, tck
>    Affects Versions: JDO 3
>            Reporter: Andy Jefferson
>             Fix For: JDO 3 maintenance release 1
>
>         Attachments: jdo-678.patch
>
>
> It would be desirable to be able to set properties on the PersistenceManager, so as to be able to configure/change behaviour for a PM. Currently the PM is generated with particular configuration (from the PMF) and allows specific options to be set. But what about vendor extensions ? Having a general setProperty/getProperty/getSupportedProperties would be useful, and could also encompass the existing detachAllOnCommit, IgnoreCache, etc settings.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (JDO-678) Ability to set properties on PersistenceManager

Posted by "Michael Bouschen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Bouschen reassigned JDO-678:
------------------------------------

    Assignee: Craig L Russell

> Ability to set properties on PersistenceManager
> -----------------------------------------------
>
>                 Key: JDO-678
>                 URL: https://issues.apache.org/jira/browse/JDO-678
>             Project: JDO
>          Issue Type: Improvement
>          Components: api, specification, tck
>    Affects Versions: JDO 3
>            Reporter: Andy Jefferson
>            Assignee: Craig L Russell
>             Fix For: JDO 3 maintenance release 1
>
>         Attachments: jdo-678.patch
>
>
> It would be desirable to be able to set properties on the PersistenceManager, so as to be able to configure/change behaviour for a PM. Currently the PM is generated with particular configuration (from the PMF) and allows specific options to be set. But what about vendor extensions ? Having a general setProperty/getProperty/getSupportedProperties would be useful, and could also encompass the existing detachAllOnCommit, IgnoreCache, etc settings.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (JDO-678) Ability to set properties on PersistenceManager

Posted by "Craig L Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13005774#comment-13005774 ] 

Craig L Russell commented on JDO-678:
-------------------------------------

If I had it to do again, I'd probably return Map<?, ?> from PMF.getProperties() since what is returned should be able to be used to configure a new PMF via the JDOHelper.getPersistenceManagerFactory(Map<?, ?>).

So returning a Map<String, Object> is ok with me. I don't see a use case for an Object as a key... All of the properties we want to configure have been given names.

We will need to specify what to expect in the returned Map. Do we expect to have all of the existing "properties" represented? Do they have the javax.jdo namespace? How do we map the existing properties?

For example, getCopyOnAttach. There is a definition of a string key in javax.jdo.Constants
static String PROPERTY_COPY_ON_ATTACH
        = "javax.jdo.option.CopyOnAttach";

key: javax.jdo.option.CopyOnAttach value: Boolean.FALSE or value: "false"

Is it an option, or should we use a different key?


> Ability to set properties on PersistenceManager
> -----------------------------------------------
>
>                 Key: JDO-678
>                 URL: https://issues.apache.org/jira/browse/JDO-678
>             Project: JDO
>          Issue Type: Improvement
>          Components: api, specification, tck
>    Affects Versions: JDO 3
>            Reporter: Andy Jefferson
>            Assignee: Andy Jefferson
>             Fix For: JDO 3 maintenance release 1
>
>         Attachments: jdo-678.patch
>
>
> It would be desirable to be able to set properties on the PersistenceManager, so as to be able to configure/change behaviour for a PM. Currently the PM is generated with particular configuration (from the PMF) and allows specific options to be set. But what about vendor extensions ? Having a general setProperty/getProperty/getSupportedProperties would be useful, and could also encompass the existing detachAllOnCommit, IgnoreCache, etc settings.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (JDO-678) Ability to set properties on PersistenceManager

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13003963#comment-13003963 ] 

Andy Jefferson commented on JDO-678:
------------------------------------

Well a Properties ought to have String values only (even though it actually implements Map<Object,Object>). A vendor may allow non-String values (setProperty(String, Object)). For example, the PMF has a setting javax.jdo.option.DatastoreReadTimeoutMillis which is an integer, and the PM could allow setting of the same thing taking in an Integer. Vendor specifics may also be non-String.

> Ability to set properties on PersistenceManager
> -----------------------------------------------
>
>                 Key: JDO-678
>                 URL: https://issues.apache.org/jira/browse/JDO-678
>             Project: JDO
>          Issue Type: Improvement
>          Components: api, specification, tck
>    Affects Versions: JDO 3
>            Reporter: Andy Jefferson
>            Assignee: Andy Jefferson
>             Fix For: JDO 3 maintenance release 1
>
>         Attachments: jdo-678.patch
>
>
> It would be desirable to be able to set properties on the PersistenceManager, so as to be able to configure/change behaviour for a PM. Currently the PM is generated with particular configuration (from the PMF) and allows specific options to be set. But what about vendor extensions ? Having a general setProperty/getProperty/getSupportedProperties would be useful, and could also encompass the existing detachAllOnCommit, IgnoreCache, etc settings.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (JDO-678) Ability to set properties on PersistenceManager

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13006157#comment-13006157 ] 

Andy Jefferson commented on JDO-678:
------------------------------------

I would expect all existing (standard) properties to be present (those that have setters/getters currently - Multithreaded, IgnoreCache, DatastoreReadTimeoutMillis, DatastoreWriteTimeoutMillis, DetachAllOnCommit, CopyOnAttach). And I'd use the same PMF namings javax.jdo.option.XXX for consistency.

So getSupportedProperties would return the standard (existing) properties, as well as vendor extensions, and getProperty(name), setProperty(name, val) would take in "name" of javax.jdo.option.XXX for the existing properties (as well as any vendor extensions).

> Ability to set properties on PersistenceManager
> -----------------------------------------------
>
>                 Key: JDO-678
>                 URL: https://issues.apache.org/jira/browse/JDO-678
>             Project: JDO
>          Issue Type: Improvement
>          Components: api, specification, tck
>    Affects Versions: JDO 3
>            Reporter: Andy Jefferson
>            Assignee: Andy Jefferson
>             Fix For: JDO 3 maintenance release 1
>
>         Attachments: jdo-678.patch
>
>
> It would be desirable to be able to set properties on the PersistenceManager, so as to be able to configure/change behaviour for a PM. Currently the PM is generated with particular configuration (from the PMF) and allows specific options to be set. But what about vendor extensions ? Having a general setProperty/getProperty/getSupportedProperties would be useful, and could also encompass the existing detachAllOnCommit, IgnoreCache, etc settings.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (JDO-678) Ability to set properties on PersistenceManager

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Jefferson updated JDO-678:
-------------------------------

    Attachment: jdo-678.patch

Proposed patch to PersistenceManager. I've called the new methods setProperty, getProperties, getSupportedProperties. Obviously since the PMF has "supportedOptions" and "getProperties" there may be other opinions, so welcome to suggestions that unify things

> Ability to set properties on PersistenceManager
> -----------------------------------------------
>
>                 Key: JDO-678
>                 URL: https://issues.apache.org/jira/browse/JDO-678
>             Project: JDO
>          Issue Type: Improvement
>          Components: api, specification, tck
>            Reporter: Andy Jefferson
>         Attachments: jdo-678.patch
>
>
> It would be desirable to be able to set properties on the PersistenceManager, so as to be able to configure/change behaviour for a PM. Currently the PM is generated with particular configuration (from the PMF) and allows specific options to be set. But what about vendor extensions ? Having a general setProperty/getProperty/getSupportedProperties would be useful, and could also encompass the existing detachAllOnCommit, IgnoreCache, etc settings.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira