Fetched Groups - CMR
I'm having problems with CMR fields.
My ejb-jar.xml & sun-ejb-jar.xml files are correct.
Can anyone explain me the use of fetched groups ?
Explanation of the tag <fetched-with></fetched-with>?
Thankx
D.Geerts
The following errors occurs all the time :
Validation error in bean PublicatieE: The field tdUitgeverNId has an invalid fetch group. Default is not a valid fetch group for managed fields. If your field is not a managed field, it may be treated as one if you have a CMR to this bean which is mapped to the same column as tdUitgeverNId.
Select a different fetch group.
[28/Oct/2003:15:38:35] WARNING ( 748): DPL5035:Error while running ejbc
com.iplanet.ias.deployment.backend.IASDeploymentException: Fatal Error from EJB Compiler -- -- Error while processing CMP beans.
at com.iplanet.ias.deployment.backend.EJBCompiler.wrapException(EJBCompiler.java:589)
at com.iplanet.ias.deployment.backend.EJBCompiler.compile(EJBCompiler.java:186)
at com.iplanet.ias.deployment.backend.EjbModuleDeployer.runEJBC(EjbModuleDeployer.java:246)
at com.iplanet.ias.deployment.backend.EjbModuleDeployer.deploy(EjbModuleDeployer.java:128)
at com.iplanet.ias.deployment.backend.ModuleDeployer.redeploy(ModuleDeployer.java:581)
at com.iplanet.ias.deployment.backend.ModuleDeployer.doRequest(ModuleDeployer.java:84)
at com.iplanet.ias.admin.server.core.mbean.config.ManagedServerInstance.deployEJBJarModuleArchiveOrDirectory(ManagedServerInstance.java:894)
at com.iplanet.ias.admin.server.core.mbean.config.ManagedServerInstance.deployEJBJarModule(ManagedServerInstance.java:844)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
A fetch group controls when an attribute is fetched. All attributes in the default fetch group are read from the database when the bean is accessed, but attributes in named fetch groups are read only when explicitly accessed. When that happens, all attributes in the same group are read together. Now the problem with managed fields is that you probably have an attribute associated with a column that is also used as a foreign key in a relationship. It then becomes a managed field. What I do in those situations, to get around the problem, is to use a named fetch group, such as "FK" (foreign key) for such attributes.
This is a problem only with database designs that doesn't use synthetic keys, and you therefore need an accessor for the key value itself. With syntheric keys, you would probably get the related bean instead of its key, and you would then not have any attributes mapped to the key column, only relationships.
Hope this was not entirely unclear.
Similar Messages
-
In the past I asked that Kodo supports multiple optimistic transaction
groups for fine grain concurrency control
I would also like to see multiple fetch groups so I can give JDQL a hint
which fetch group(s) to prefetch on query execution. When Kodo supports
batch loading multiple fetch groups will provide essential mechanism for
controling batch loadingWe provide APIs for configuring a PM's and a Query's current fetch
groups.
-Patrick
On Wed, 26 Feb 2003 19:10:45 -0500, Alex Roytman wrote:
do you allow to pass a hint to JDOQL which fetch group(s) you want
eagerly loaded ?
"Abe White" <[email protected]> wrote in message
news:[email protected]..
Multiple fetch groups are implemented in Kodo 2.5.
Patrick Linskey
SolarMetric Inc. -
SQL batch doesn't work; How to fetch related objects with fetch group?
I have two questions:
1. SQL Batch doesn't seem to work. I have tested some batch object creation
with BatchLimit set to -1, 0, 1, 25, 100. They all have similar
performance.
kodo.jdbc.DBDictionary: BatchLimit=25
2. How to use custom fetch group to fetch related objects? The example of
custom fetch group only show how to fetch different attributes in different
groups. I have a test cases where I would like to pre-fetch related objects
to save round trip.
Enviroments:
* Kodo 3.1.0 RC1
* Oracle 9i release 1
Thanks for any help!
Qingshan Luo
Senior Software Engineer
Open Harbor
1123 Industrial Road
San Carlos, CA 94070
Phone: 650-413-4251
Fax: 650-413-4298try poracle 10g driver. At least they fixed terrible CLOB bug may be batch
to. BTW 9.2.x has problem with batching with deferred constraints so be
careful
"Greg Campbell" <[email protected]> wrote in message
news:c3dmnu$rmj$[email protected]..
>
"Qingshan Luo" <[email protected]> wrote in message
news:c3dg7q$mdl$[email protected]..
Hi,
I have two technical questions with Kodo.
1. SQL Batch doesn't seem to work. I have tried batch size of -1, 0, 1,25.
But the performance from batch creating objects is not affected by batch
size.
kodo.jdbc.DBDictionary: BatchLimit=25You may be running into a bug in the Oracle 9.2 driver. That driverdoesn't
reliably give update counts when using batching and prepared statement
caching. By default, Kodo will turn off batching. You can manuallyenable
batching by setting the BatchLimit on your DBDictionary, as you've done.If
you do this, though, you may want to turn off prepared statement cachingby
setting MaxCachedStatements to 0 (see
http://www.solarmetric.com/Software/Documentation/3.1.0RC1/docs/ref_guide_dbsetup.html#ref_guide_dbsetup_builtin).
>
2. How to use custom fetch groups to eagerly fetch related persistable
objects? Example only showed attributes, not relationships.You can find information on setting up eager fetching of relations at
http://www.solarmetric.com/Software/Documentation/3.0.3/docs/ref_guide_
perfpack_eager.html
Basically, you'll need to add the relations to your fetch group, and
set the eager fetching mode.
Enviroment:
* Kodo 3.1.0 RC1
* Oracle 9i release 1.
Qingshan Luo
Senior Software Engineer
Open Harbor
1123 Industrial Road
San Carlos, CA 94070
Phone: 650-413-4251
Fax: 650-413-4298 -
Hi there,
i want to constitute fetch groups for my descriptor. But i don't know or find a tutorial about what will happen to my cache when i query with that fetch group. Will the objects (pojos) be put into the cache? In partial object queries, we cannot cache partial objects. In fetch groups, can we cache the objects?Fetch groups currently only work for EJB 2.x CMP Entity Beans, not POJOs. For POJO apps you can use partial object queries but as you say, queried objects are not cached.
--Shaun -
Need scripts for fetching groups and subgroups info , script for del users
Hi ,
I need a script or macro which will fetch list of groups and sub groups triend forums download did not fine one.
I need another script which will delete listed users there is a macro in forums but it doesn't suit my rquirement.
Any one have these scripts handy with you please help me with that,
Regards,
Neo.Hi Braham,
Thanks for your quick reply.
Are we able to do this on two stage method
1. grab the security groups from the share paths
if can grab the share path from a separate txt file than copying it to the <your path> location
so i can modify the txt file
once run the script
if can the output like below to a CSV file
\\servername\foldermain\folder1group 1group 2group 3\\servername\foldermain\folder2group 1group 2group 3then i know which groups belongs to which share paththen i can remove the duplicate groups and keep the common groups to grab the users belongs to itso with the second script same as the first copy the security groups to a txt file and the out put as below.what I needs is the users full name and the samaccount name ( user id )group 1user1user2user3
group 2user1user2user3looking forward your help on thisThank you.Thilo -
SQL Batch doesn't seem to work; How to eager-fetch related objects?
Hi,
I have two technical questions with Kodo.
1. SQL Batch doesn't seem to work. I have tried batch size of -1, 0, 1, 25.
But the performance from batch creating objects is not affected by batch
size.
kodo.jdbc.DBDictionary: BatchLimit=25
2. How to use custom fetch groups to eagerly fetch related persistable
objects? Example only showed attributes, not relationships.
Enviroment:
* Kodo 3.1.0 RC1
* Oracle 9i release 1.
Qingshan Luo
Senior Software Engineer
Open Harbor
1123 Industrial Road
San Carlos, CA 94070
Phone: 650-413-4251
Fax: 650-413-4298try poracle 10g driver. At least they fixed terrible CLOB bug may be batch
to. BTW 9.2.x has problem with batching with deferred constraints so be
careful
"Greg Campbell" <[email protected]> wrote in message
news:c3dmnu$rmj$[email protected]..
>
"Qingshan Luo" <[email protected]> wrote in message
news:c3dg7q$mdl$[email protected]..
Hi,
I have two technical questions with Kodo.
1. SQL Batch doesn't seem to work. I have tried batch size of -1, 0, 1,25.
But the performance from batch creating objects is not affected by batch
size.
kodo.jdbc.DBDictionary: BatchLimit=25You may be running into a bug in the Oracle 9.2 driver. That driverdoesn't
reliably give update counts when using batching and prepared statement
caching. By default, Kodo will turn off batching. You can manuallyenable
batching by setting the BatchLimit on your DBDictionary, as you've done.If
you do this, though, you may want to turn off prepared statement cachingby
setting MaxCachedStatements to 0 (see
http://www.solarmetric.com/Software/Documentation/3.1.0RC1/docs/ref_guide_dbsetup.html#ref_guide_dbsetup_builtin).
>
2. How to use custom fetch groups to eagerly fetch related persistable
objects? Example only showed attributes, not relationships.You can find information on setting up eager fetching of relations at
http://www.solarmetric.com/Software/Documentation/3.0.3/docs/ref_guide_
perfpack_eager.html
Basically, you'll need to add the relations to your fetch group, and
set the eager fetching mode.
Enviroment:
* Kodo 3.1.0 RC1
* Oracle 9i release 1.
Qingshan Luo
Senior Software Engineer
Open Harbor
1123 Industrial Road
San Carlos, CA 94070
Phone: 650-413-4251
Fax: 650-413-4298 -
How to get BU, Company, Group details with the help of Employee number
Hi Friends,
How to get information related with Employee like Business unit, Company, Business Group and other details.
PravinYes Arul.
I want to get these information in a custom Java webdynpro application but if you can guide me how to get these values in SAP-Hr. Can you just give me details of tables. I have Employee number(pernr) with me and want to fetch Group, Company, Business Unit.
With rgds,
Pravin -
ORA-01002/ Fetch out of sequence on lazy loading
Hello,
We are facing an oracle SQLException (ORA-01002: fetch out of sequence)
while we are trying to get a field (retrieved via lazy loading) from an
object that was retrieved using a kodoquery.
This error only occurs during performance testing under a heavy load.
(100 concurrent users). For each thread we get a new persistencemanager
from the factory. And we have put the multithreaded option to true.
Can anyone help us with this problem?
Thanks in advance,
Kind Regards,
Niels Soeffers
Caused by: java.sql.SQLException: ORA-01002: fetch out of sequence
at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
at
oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
at
oracle.jdbc.driver.T4CPreparedStatement.fetch(T4CPreparedStatement.java:1027)
at
oracle.jdbc.driver.OracleResultSetImpl.close_or_fetch_from_next(OracleResultSetImpl.java:291)
at
oracle.jdbc.driver.OracleResultSetImpl.next(OracleResultSetImpl.java:213)
at
com.solarmetric.jdbc.DelegatingResultSet.next(DelegatingResultSet.java:97)
at kodo.jdbc.sql.ResultSetResult.nextInternal(ResultSetResult.java:151)
at kodo.jdbc.sql.AbstractResult.next(AbstractResult.java:123)
at kodo.jdbc.sql.Select$SelectResult.next(Select.java:2236)
at
kodo.jdbc.meta.AbstractCollectionFieldMapping.load(AbstractCollectionFieldMapping.java:592)
at kodo.jdbc.runtime.JDBCStoreManager.load(JDBCStoreManager.java:521)
at
kodo.runtime.DelegatingStoreManager.load(DelegatingStoreManager.java:133)
at kodo.runtime.ROPStoreManager.load(ROPStoreManager.java:79)
at kodo.runtime.StateManagerImpl.loadFields(StateManagerImpl.java:3166)
at kodo.runtime.StateManagerImpl.loadField(StateManagerImpl.java:3265)
at kodo.runtime.StateManagerImpl.isLoaded(StateManagerImpl.java:1386)
at
com.ardatis.ventouris.domain.OntvangstReeks.jdoGetontvangstTransacties(OntvangstReeks.java)
at
com.ardatis.ventouris.domain.OntvangstReeks.getStatus(OntvangstReeks.java:72)
at
com.ardatis.ventouris.service.financien.transfer.FinancienTOAssembler.getOntvangstReeksBaseTO(FinancienTOAssembler.java:71)
at
com.ardatis.ventouris.service.financien.transfer.FinancienTOAssembler.getOntvangstReeksBaseTOs(FinancienTOAssembler.java:84)
at
com.ardatis.ventouris.service.financien.FinancienManagerImpl.getOntvangstReeksBaseTOs(FinancienManagerImpl.java:241)
at
com.ardatis.ventouris.service.financien.ejb.FinancienManagerBean.getOntvangstReeksBaseTOs(FinancienManagerBean.java:62)
at sun.reflect.GeneratedMethodAccessor181.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.enterprise.security.SecurityUtil$2.run(SecurityUtil.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at
com.sun.enterprise.security.application.EJBSecurityManager.doAsPrivileged(EJBSecurityManager.java:950)
at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:158)
at
com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:128)
at $Proxy31.getOntvangstReeksBaseTOs(Unknown Source)
at sun.reflect.GeneratedMethodAccessor155.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:123)We are using Oracle 10g and have tried multiple dirvers. (classes12.jar,
ojdbc14.jar)
Our kodo.properties ( actually the ra.xml we supply with the kodo.rar )
<connector>
<display-name>KodoJDO</display-name>
<description>Resource Adapter for integration of the Kodo Java Data
Objects (JDO) implementation with J2EE 1.3 compliant managed
environments</description>
<vendor-name>Solarmetric, Inc.</vendor-name>
<spec-version>1.0</spec-version>
<eis-type>jdo</eis-type>
<version>1.0</version>
<license>
<description>
See http://www.solarmetric.com for terms and license conditions.
</description>
<license-required>true</license-required>
</license>
<resourceadapter>
<managedconnectionfactory-class>kodo.jdbc.ee.JDBCManagedConnectionFactory</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.cci.ConnectionFactory</connectionfactory-interface>
<connectionfactory-impl-class>kodo.jdbc.ee.JDBCConnectionFactory</connectionfactory-impl-class>
<connection-interface>javax.resource.cci.Connection</connection-interface>
<connection-impl-class>kodo.runtime.PersistenceManagerImpl</connection-impl-class>
<transaction-support>XATransaction</transaction-support>
<config-property>
<description>A comma-separated list of query aggregate listeners
to add to the default list of extensions. Each listener must implement
the kodo.jdbc.query.JDBCAggregateListener interface.</description>
<config-property-name>AggregateListeners</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
<config-property>
<description>The kodo.jdbc.meta.ClassIndicator to use by default
for new mappings. The class indicator is responsible for tracking the
concrete class or subclass implemented by the object stored in each row of
a table.</description>
<config-property-name>ClassIndicator</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>in-class-name</config-property-value>
</config-property>
<config-property>
<description>The kodo.util.ClassResolver implementation that
should be used for JDO class resolution. Defaults to a JDO spec-compliant
resolver.</description>
<config-property-name>ClassResolver</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>spec</config-property-value>
</config-property>
<config-property>
<description>Details about various compatibiity levels for the
current environment.</description>
<config-property-name>Compatibility</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>true</config-property-value>
</config-property>
<config-property>
<description>The class name of either the JDBC java.sql.Driver, or
an instance of a javax.sql.DataSource to use to connect to the non-XA data
source.</description>
<config-property-name>Connection2DriverName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
<config-property>
<description>The password for the user specified in
Connection2UserName</description>
<config-property-name>Connection2Password</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
<config-property>
<description>A comma-separated list of properties to be passed to
the non-XA JDBC Driver when obtaining a Connection. Properties are of the
form "key=value". If the given JDBC Driver class is a DataSource, these
properties will be used to configure the bean properties of the
DataSource. </description>
<config-property-name>Connection2Properties</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
<config-property>
<description>The URL for the non-XA data source.</description>
<config-property-name>Connection2URL</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
<config-property>
<description>The username for the connection listed in
Connection2URL.</description>
<config-property-name>Connection2UserName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
<config-property>
<description>A comma-separated list of
com.solarmetric.jdbc.ConnectionDecorator implementations to install on all
connection pools.</description>
<config-property-name>ConnectionDecorators</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
<config-property>
<description>The class name of either the JDBC java.sql.Driver, or
an instance of a javax.sql.DataSource to use to connect to the data
source.</description>
<config-property-name>ConnectionDriverName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
<config-property>
<description>The JNDI name of the connection factory to use for
finding non-XA connections. If specified, this is the connection that
will be used for obtaining sequence numbers.</description>
<config-property-name>ConnectionFactory2Name</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>jdbc/VentourisNonXA</config-property-value>
</config-property>
<config-property>
<description>A comma-separated list of properties used to
configure the javax.sql.DataSource used as the non-XA ConnectionFactory.
Each property should be of the form "key=value", where "key" is the name
of some bean-like property of the data source.</description>
<config-property-name>ConnectionFactory2Properties</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
<config-property>
<description>The JNDI name of the connection factory to use for
obtaining connections.</description>
<config-property-name>ConnectionFactoryName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>jdbc/Ventouris</config-property-value>
</config-property>
<config-property>
<description>A comma-separated list of properties used to
configure the javax.sql.DataSource used as the ConnectionFactory. Each
property should be of the form "key=value", where "key" is the name of
some bean-like property of the data source.</description>
<config-property-name>ConnectionFactoryProperties</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
<config-property>
<description>The password for the user specified in
ConnectionUserName</description>
<config-property-name>ConnectionPassword</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
<config-property>
<description>A comma-separated list of properties to be passed to
the JDBC Driver when obtaining a Connection. Properties are of the form
"key=value". If the given JDBC Driver class is a DataSource, these
properties will be used to configure the bean properties of the
DataSource. </description>
<config-property-name>ConnectionProperties</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
<config-property>
<description>This property dictates when PersistenceManagers will
retain and release data store connections. Available options are
"on-demand" for retaining a connection only during pessimistic
transactions and data store operations, "transaction" for retaining a
connection for the life of each transaction, or "persistence-manager" to
indicate that a persistence manager should retain and reuse a single
connection for its entire lifespan.</description>
<config-property-name>ConnectionRetainMode</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>transaction</config-property-value>
</config-property>
<config-property>
<description>The URL for the data source.</description>
<config-property-name>ConnectionURL</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
<config-property>
<description>The username for the connection listed in
ConnectionURL.</description>
<config-property-name>ConnectionUserName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
<config-property>
<description>Set to true if you''d like Kodo to copy all object
ids before returning them to your code. If you do not plan on modifying
identity objects, you can set this property to false to avoid the copying
overhead.</description>
<config-property-name>CopyObjectIds</config-property-name>
<config-property-type>java.lang.Boolean</config-property-type>
<config-property-value>false</config-property-value>
</config-property>
<config-property>
<description>Plugin used to cache data loaded from the data store.
Must implement kodo.datacache.DataCache.</description>
<config-property-name>DataCache</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
<config-property>
<description>The number of milliseconds that data in the data
cache is valid for. A value of 0 or less means that by default, cached
data does not time out.</description>
<config-property-name>DataCacheTimeout</config-property-name>
<config-property-type>java.lang.Integer</config-property-type>
<config-property-value>-1</config-property-value>
</config-property>
<config-property>
<description>The type of data source in use. Available options
are "local" for a standard data source under Kodo''s control, or
"enlisted" for a data source managed by an application server and
automatically enlisted in global transactions.</description>
<config-property-name>DataSourceMode</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>enlisted</config-property-value>
</config-property>
<config-property>
<description>The kodo.jdbc.sql.DBDictionary to use for database
interaction. This is auto-detected based on the setting of
javax.jdo.option.ConnectionURL, so you need only set this to override the
default with your own custom dictionary or if you are using an
unrecognized driver.</description>
<config-property-name>DBDictionary</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
<config-property>
<description>Whether to dynamically create custom structs to hold
and transfer persistent state in the Kodo data cache and remote
persistence manager frameworks. Dynamic structs can reduce data cache
memory consumption, reduce the amount of data serialized back and forth
under remote persistence managers, and improve the overall performance of
these systems. However, they increase application warm-up time while the
custom classes are generated and loaded into the JVM. Set to true to
enable dynamic data structs.</description>
<config-property-name>DynamicDataStructs</config-property-name>
<config-property-type>java.lang.Boolean</config-property-type>
<config-property-value>false</config-property-value>
</config-property>
<config-property>
<description>Specifies the default eager fetch mode to use.
Either "none" to never eagerly-load relations, "join" for selecting 1-1
relations along with the target object using inner or outer joins, or
"parallel" for selecting 1-1 relations via joins, and collections
(including to-many relations) along with the target object using separate
select statements executed in parallel.</description>
<config-property-name>EagerFetchMode</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>parallel</config-property-value>
</config-property>
<config-property>
<description>The number of rows that will be pre-fetched when an
element in a Query result is accessed. Use -1 to pre-fetch all
results.</description>
<config-property-name>FetchBatchSize</config-property-name>
<config-property-type>java.lang.Integer</config-property-type>
<config-property-value>-1</config-property-value>
</config-property>
<config-property>
<description>The name of the JDBC fetch direction to use.
Standard values are "forward", "reverse", and "unknown".</description>
<config-property-name>FetchDirection</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>forward</config-property-value>
</config-property>
<config-property>
<description>A comma-separated list of fetch group names that
PersistenceManagers will load by default when loading data from the data
store.</description>
<config-property-name>FetchGroups</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
<config-property>
<description>A comma-separated list of query filter listeners to
add to the default list of extensions. Each listener must implement the
kodo.jdbc.query.JDBCFilterListener interface.</description>
<config-property-name>FilterListeners</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
<config-property>
<description>Whether or not Kodo should automatically flush
modifications to the data store before executing queries.</description>
<config-property-name>FlushBeforeQueries</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>with-connection</config-property-value>
</config-property>
<config-property>
<description>If true, Kodo will order all SQL inserts, updates,
and deletes to meet your schema''s foreign key constraints. Defaults to
false.</description>
<config-property-name>ForeignKeyConstraints</config-property-name>
<config-property-type>java.lang.Boolean</config-property-type>
<config-property-value>false</config-property-value>
</config-property>
<config-property>
<description>If false, then the JDO implementation must consider
modifications, deletions, and additions in the PersistenceManager
transaction cache when executing a query inside a transaction. Else, the
implementation is free to ignore the cache and execute the query directly
against the data store.</description>
<config-property-name>IgnoreCache</config-property-name>
<config-property-type>java.lang.Boolean</config-property-type>
<config-property-value>true</config-property-value>
</config-property>
<config-property>
<description>Plugin used to manage inverse relations during flush.
Set to true to use the default inverse manager. Custom inverse managers
must extend kodo.runtime.InverseManager.</description>
<config-property-name>InverseManager</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>false</config-property-value>
</config-property>
<config-property>
<description>A comma-separated list of
com.solarmetric.jdbc.JDBCListener implementations to install on all
connection pools.</description>
<config-property-name>JDBCListeners</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
<config-property>
<description>The license key provided to you by SolarMetric. Keys
are available at www.solarmetric.com</description>
<config-property-name>LicenseKey</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value><KEY-REMOVED></config-property-value>
</config-property>
<config-property>
<description>Plugin used to handle acquiring locks on persistent
instances. Must implement kodo.runtime.LockManager.</description>
<config-property-name>LockManager</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>pessimistic</config-property-value>
</config-property>
<config-property>
<description>The number of milliseconds to wait for an object lock
before throwing an exception, or -1 for no limit.</description>
<config-property-name>LockTimeout</config-property-name>
<config-property-type>java.lang.Integer</config-property-type>
<config-property-value>-1</config-property-value>
</config-property>
<config-property>
<description>LogFactory and configuration for Kodo''s logging
needs.</description>
<config-property-name>Log</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>kodo(DefaultLevel=WARN, Tool=WARN,
Runtime=WARN, SQL=WARN)</config-property-value>
</config-property>
<config-property>
<description>The mode to use for calculating the size of large
result sets. Legal values are "unknown", "last", and "query".</description>
<config-property-name>LRSSize</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>query</config-property-value>
</config-property>
<config-property>
<description>Plugin used to integrate with an external transaction
manager. Must implement kodo.runtime.ManagedRuntime.</description>
<config-property-name>ManagedRuntime</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>auto</config-property-value>
</config-property>
<config-property>
<description>Plugin used to configure management and profiling
capabilities.</description>
<config-property-name>ManagementConfiguration</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>none</config-property-value>
</config-property>
<config-property>
<description>The kodo.jdbc.meta.MappingFactory that will provide
the object-relational mapping information needed to map each persistent
class to the database.</description>
<config-property-name>MappingFactory</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>file</config-property-value>
</config-property>
<config-property>
<description>Plugin used to create metadata about persistent
types. Must implement kodo.meta.MetaDataLoader</description>
<config-property-name>MetaDataLoader</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>jdo</config-property-value>
</config-property>
<config-property>
<description>If true, then the application plans to have multiple
threads simultaneously accessing a single PersistenceManager, so measures
must be taken to ensure that the implementation is thread-safe. Otherwise,
the implementation need not address thread safety.</description>
<config-property-name>Multithreaded</config-property-name>
<config-property-type>java.lang.Boolean</config-property-type>
<config-property-value>true</config-property-value>
</config-property>
<config-property>
<description>If true, then it is possible to read persistent data
outside the context of a transaction. Otherwise, a transaction must be in
progress in order read data.</description>
<config-property-name>NontransactionalRead</config-property-name>
<config-property-type>java.lang.Boolean</config-property-type>
<config-property-value>true</config-property-value>
</config-property>
<config-property>
<description>If true, then it is possible to write to fields of a
persistent-nontransactional object when a transaction is not in progress.
If false, such a write will result in a JDOUserException.</description>
<config-property-name>NontransactionalWrite</config-property-name>
<config-property-type>java.lang.Boolean</config-property-type>
<config-property-value>false</config-property-value>
</config-property>
<config-property>
<description>Determines the persistence manager's behavior in
calls to getObjectById with a validate parameter of false. Use "check" to
check that a database record exists for the object and load its fetch
group fields. Use "hollow" to return a hollow instance.</description>
<config-property-name>ObjectLookupMode</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>check</config-property-value>
</config-property>
<config-property>
<description>Selects between optimistic and pessimistic (data
store) transactional modes.</description>
<config-property-name>Optimistic</config-property-name>
<config-property-type>java.lang.Boolean</config-property-type>
<config-property-value>true</config-property-value>
</config-property>
<config-property>
<description>Action to take when Kodo discovers an orphaned key in
the database. May be a custom action implementing
kodo.event.OrphanedKeyAction.</description>
<config-property-name>OrphanedKeyAction</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>log</config-property-value>
</config-property>
<config-property>
<description>The name of the concrete implementation of
javax.jdo.PersistenceManagerFactory that
javax.jdo.JDOHelper.getPersistenceManagerFactory () should create. For
Kodo JDO, this should be kodo.jdbc.runtime.JDBCPersistenceManagerFactory
or a custom extension of this type.</description>
<config-property-name>PersistenceManagerFactoryClass</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>kodo.jdbc.runtime.JDBCPersistenceManagerFactory</config-property-value>
</config-property>
<config-property>
<description>Persistence manager plugin and properties. If you
use a custom class, it must extend
kodo.runtime.PersistenceManagerImpl.</description>
<config-property-name>PersistenceManagerImpl</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>default</config-property-value>
</config-property>
<config-property>
<description>Configure this persistence manager factory to service
remote persistence managers.</description>
<config-property-name>PersistenceManagerServer</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>false</config-property-value>
</config-property>
<config-property>
<description>A comma-separated list of the class names of all
persistent classes to register whenever a persistence manager is
obtained.</description>
<config-property-name>PersistentClasses</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>com.ardatis.ventouris.domain.KwartaalVerhoging,
com.ardatis.ventouris.domain.Land, com.ardatis.ventouris.domain.Gemeente,
com.ardatis.ventouris.domain.Adres,
com.ardatis.ventouris.domain.ContactGegeven,
com.ardatis.ventouris.domain.AdresContactGegeven,
com.ardatis.ventouris.common.type.AdresType,
com.ardatis.ventouris.domain.OntvangstTransactie,
com.ardatis.ventouris.domain.OntvangstReeks,
com.ardatis.ventouris.domain.Ontvangst,
com.ardatis.ventouris.domain.Inkomen,
com.ardatis.ventouris.domain.loopbaan.LoopbaanPeriode,
com.ardatis.ventouris.common.type.InkomenSoort,
com.ardatis.ventouris.common.type.INSZ,
com.ardatis.ventouris.domain.Aangeslotene,
com.ardatis.ventouris.domain.NatuurlijkePersoon,
com.ardatis.ventouris.domain.Persoon, com.ardatis.ventouris.domain.Rol,
com.ardatis.ventouris.domain.Dossier,
com.ardatis.ventouris.common.type.Geslacht,
com.ardatis.ventouris.common.type.Taal,
com.ardatis.ventouris.common.type.Nationaliteit,
com.ardatis.ventouris.common.type.KostType,
com.ardatis.ventouris.domain.Verhoging,
com.ardatis.ventouris.domain.Aanvraag,
com.ardatis.ventouris.domain.AanvraagAansluitingSS,
com.ardatis.ventouris.domain.AanvraagToestand,
com.ardatis.ventouris.common.type.AanvraagToestandType,
com.ardatis.ventouris.domain.Factuur,
com.ardatis.ventouris.domain.TaakType, com.ardatis.ventouris.domain.Taak,
com.ardatis.ventouris.domain.BijdrageBerekening,
com.ardatis.ventouris.domain.calculationparameters.HerwaarderingsIndex,
com.ardatis.ventouris.domain.integration.asis.TempInterneOntvangst,
com.ardatis.ventouris.domain.calculationparameters.InkomenGrens,
com.ardatis.ventouris.domain.calculationparameters.BijdrageCategorie,
com.ardatis.ventouris.domain.calculationparameters.BijdrageCategorieGroep,
com.ardatis.ventouris.domain.integration.asis.TempOntvangstKinderbijslag,
com.ardatis.ventouris.domain.calculationparameters.JaarVerhogingParameter,
com.ardatis.ventouris.domain.calculationparameters.KwartaalVerhogingParameter,
com.ardatis.ventouris.domain.UitgaveReeks,
com.ardatis.ventouris.domain.Uitgave,
com.ardatis.ventouris.domain.Terugbetaling,
com.ardatis.ventouris.domain.BedragTerugbetaald,
com.ardatis.ventouris.domain.BijdrageSS</config-property-value>
</config-property>
<config-property>
<description>Plugin used to proxy second class object fields of
managed instances. Must implement kodo.util.ProxyManager.</description>
<config-property-name>ProxyManager</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>default</config-property-value>
</config-property>
<config-property>
<description>Plugin used to cache query results loaded from the
data store. Must implement kodo.datacache.QueryCache.</description>
<config-property-name>QueryCache</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>true</config-property-value>
</config-property>
<config-property>
<description>Plugin used to cache query compilation data. Must
implement java.util.Map. Does not need to be thread-safe -- it will be
wrapped via the Collections.synchronizedMap() method if it does not extend
kodo.util.CacheMap.</description>
<config-property-name>QueryCompilationCache</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>true</config-property-value>
</config-property>
<config-property>
<description>The default lock level to use when loading objects
within non-optimistic transactions. Set to none, read, write, or the
numeric value of the desired lock level for your lock
manager.</description>
<config-property-name>ReadLockLevel</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>read</config-property-value>
</config-property>
<config-property>
<description>Plugin used to communicate commit information among
JVMs. Must implement kodo.event.RemoteCommitProvider.</description>
<config-property-name>RemoteCommitProvider</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
<config-property>
<description>Whether or not RemoteCommitEvents will include the
object Ids of objects added during the transaction.</description>
<config-property-name>RemoteCommitTransmitAddObjectIds</config-property-na -
Batch fetch optimization for lazy collections
Hi,
I feel like this question must have been asked by somebody already but couldn't find any answers in the forum.
We're trying to evaluate migrating from Hibernate to KODO JDO. One feature we use extensively from Hibernate is the "batch fetch optimization for lazy collections".
For instance, there's a class User with collection "Set<String> permissions". In the DB, there're tables USER(id, name, etc) and USER_PERMISSIONS(user_id, permission) with one-to-many relationship b/w them.
Suppose the code is the following:
query = ....;
List<User> users = (List<User>) query.execute();
for (User user : users) {
println("User: " + user.getName());
println("Permissions: " + user.getPermissions());
I've setup EagerFetchMode to parallel. For field "permissions" I had to specify default-fetch-group="true" b/c I wanted this to happen lazily. When I look through the logs, I see that permissions SQL query is executed for each user.
With Hibernate we were to setup mapping the way that permissions are not fetched at first, but when they are requested for the first user (user.getPermissions()) they are automatically selected for several users in one query using SQL IN clause (similar to the parallel mode).
Is this possible to recreate the same in KODO JDO? (JPA?) If it is, this would greatly simplify migration. Please notice, that we can't use explicit fetch groups for this, b/c we don't know ahead which collection can be navigated (in the real life User class have many relationships).
thanks in advance,
DimitryKodo doesn't have a direct analog for that behavior. The typical way to solve that problem is to keep the field out of the default fetch group, and then explicitly include the desired field in the current fetch group at runtime. In pure JDO, you can do this by creating a separate fetch group that includes the relationship field, and designating that the query should use that fetch group:
<pre>
query = ...;
query.getFetchPlan().addGroup("relationshipGroup");
List<User> users = (List<User>) query.execute();
</pre>
Kodo has JDO extensions that allow you to do this a bit more easily:
<pre>
query = ...;
((kodo.jdo.KodoFetchPlan) query.getFetchPlan()).addField("com.example.User.permissions");
List<User> users = (List<User>) query.execute();
</pre>
Finally, you can do this with Kodo's JPA extensions like so:
<pre>
import org.apache.openjpa.persistence.OpenJPAQuery;
query = (OpenJPAQuery) ...;
query.getFetchPlan().addField("com.example.User.permissions");
List<User> users = (List<User>) query.getResultList();
</pre>
Note that in all cases, you could also make this change to the current PersistenceManager / EntityManager's fetch plan instead, to make the change happen for the duration of the use of that manager. In that environment, the change would need to happen before the query was created.
(And no, I have no idea why the edit box has a 'pre' button but does not seem to do anything with the resulting tags.)
-Patrick -
I believe eager fetching can greatly benefit from more dynamic method then
predefined fetch groups.
Different queries pull different parts of object graph and only client using
object model knows what's needed for a particular query. Trying to fit
conflicting data needs into one set of fetch group is a challenge. While I
would retain this feature I would like to propose field based eager fetching
control. Which can also be used for Detached objects
Lets say we have PO with POLine collection and each POLine references
Product. If we want to eager fetch POs along with their lines and products
we could say something like
pm.getFetchConfiguration().addPath(com.peacetech.sales.PO.class, "lines");
pm.getFetchConfiguration().addPath(com.peacetech.sales.PO.class,
"lines/product");
or
pm.getFetchConfiguration().addPath(com.peacetech.sales.PO.class, pathList);
of course we would need
pm.getFetchConfiguration().removePath(com.peacetech.sales.PO.class,
"lines/product");
pm.getFetchConfiguration().addPath(com.peacetech.sales.PO.class); //remove
all for given class
This is just a crude example. In real life we should have few classes to
support the idea and main class GraphConfig or something so users can
configure, build and reuse those GraphConfig instances and use them for
various purposes like eager fetching and detaching without conflicts
I think it would be enormous help to uncouple so many conflicting issues
(fetch optimizations, optimistic locking field groups, detached graphs etc)
from one very limited concept of predefined fetch groupsMark,
I mentioned this possibility in on of my prior posts. It is not exactly what
I want (since it lack interclass relations which let you express hints for
deep graph rather than for a class and its fields) but close.
If you maintain your metadata files by hand it is too much effort but since
almost all my models and metadata are generated I can easily do (and undo)
it for each and every class/field and I will give it a try :-)
Alex
"Marc Prud'hommeaux" <[email protected]> wrote in message
news:[email protected]...
Alex-
Well, you could always simulate dynamic fetch groups by defining a
different custom fetch group for each field (provided your license has
the capability to use custom fetch groups). For simplicity, you could
name each fetch group to be "ClassName.fieldName".
That way, you could do something like this:
KodoQuery kq = (KodoQuery) pm.newQuery (MyClass.class, "someQuery");
kq.getFetchConfiguration ().addFetchGroup ("MyClass.fieldA");
kq.getFetchConfiguration ().addFetchGroup ("MyClass.fieldB");
kq.getFetchConfiguration ().addFetchGroup ("MyClass.fieldC");
kq.getFetchConfiguration ().addFetchGroup ("MyClass.fieldD");
Collection results = (Collection) kq.execute ();
It would them be pretty simple to make a static helper method that will
do thing like includeAllFieldsInFatchGroup() or
includeNoFieldsInFetchGroup().
In article <[email protected]>, Alex Roytman wrote:
David Tinker says multiple fetch group is the solution:
Hi Alex
You can create as many fetch groups as you like in the meta data (with
JDO
Genie anyway). I think it is much better to get tuning information likethis
out of the code. It should be added externally much like you add indexesto
database tables in response to query search requirements. I understandthat
sometimes you will need programatic control but mostly it is better notto
pollute the code.
JDO 2.0 is going to standardize the concept of a use-case. This willdelimit
business operations to the JDO implementation so it can applyappropriate
meta-data defined fetch groups or locking strategies. You will be ableto
use a vendor supplied tool to analyze the performance of yourapplication
and construct fetch groups for different use-cases (businessoperations). No
change to the code is necessary.
Here is an example:
CODE
pm.beginUseCase("com.peacetech.sales.displayOrder");
POClass o = (POClass)pm.getObjectById(oid, true);
.... other JDO code ....
pm.endUseCase();
The meta data for the use-case will specify the fetch group to use when
looking up the instance (and locking behaviour etc.). Other use-casescan
have different settings. Only the being/end calls are needed in the codeto
make this happen.
Note that this is a very long way from being finalized. I have just madeup
this example and how it works in JDO 2.0 is likely to be different.
Use-case support will show up in JDO Genie beta releases soon. Wealready
have powerful performance monitoring and analysis support in our GUI
Workbench and very flexible fetch groups.
Cheers
David
Here's my opinion
David,
Thank you for your response. Multiple fetch groups do give moreflexibility
(I do not believe Kodo supports it though) but does not alter myposition
>>
I do not want to pollute my metadata with tons of fetch groups creating
dependencies between my code and those fetch groups. JDOQL languagebeing
what it is already creates unavoidable dependency between field namesfilter
strings so I want to keep it the same way with other things which are
essentially references to persistent fields (Disconnected instancesdepth
control, Eagar fetching ....)
As for polluting my code. I want to assure you everything configurablewill
not be in my code but in JNDI or config files. As long as JDO givesclear
API for expressing graph path selection
Use case concept ties nicely with Graph Path selection concept. In factthis
GraphPaths class along with some additional options is your use case.
It is much easer for me to refactor and keep in sync field names and my
GraphPath than fetch groups.
Alex
"Abe White" <[email protected]> wrote in message
news:[email protected]...
I think the basic idea you've suggested is a good one. We'll certainly
consider it for a future release. The JDO 2 spec team is also
pondering
these problems...
Marc Prud'hommeaux [email protected]
SolarMetric Inc. http://www.solarmetric.com -
ADF/BC4J fetches all rows, should fetch only if needed
Hello,
I'm using JDeveloper 10.1.2. Technologies are Struts, ADF and BC4J.
I have a problem with viewObjects. I have created components from database tables. I'm fetching in appModuleImpl:
ViewObjImpl impl = getObjectViewImpl();
impl.setWhereClause("id=101");
impl.executeQuery();Problem is that when page is loaded, it fetches ALL ROWS (80 000 rows)from table and then makes another query to fetch group above. I want only fetch rows that i decide to fetch. My application is in immediate mode. Couple of iterators has fetch range -1 and couple 10.
I have debugged that the first ALL ROWS fetch is made somewhere out of my code.
What i'm doing wrong? Any feature development hints are welcome also.
Thank you advance!
nullhello
First of all thank you for commenting on my timeout post
I think i have a solution for you problem.
If i understand you correctly, when the page is loaded, you only want the framework to only fetch one page worth of rows, look yahoo and google. Then when you select another page, you want the other records to be fetch.
public void executeQuery() {
setAccessMode(RowSet.RANGE_PAGING); //shall do the trick
super.executeQuery();
Djbo.debugoutput=console
SELECT * FROM (SELECT /*+ FIRST_ROWS */ IQ.*, ROWNUM AS Z_R_N FROM (select * from emp) IQ WHERE ROWNUM < :0) WHERE Z_R_N > :1
[253] Bind params for ViewObject: ViewObj1
[254] setting rownum query between (0, 4)
As shown above, the query is designed to only fetch 4 rows and this is managed by manipulating the ROWNUM.
When you run it the page will only display RANGE_PAGE only execpt of the 80,000 and your first page will run very fast
This will cause a database hit each time you select another page! If you ask the framework designer, i bet, they shall tell you we are avoiding database hits with this. My answer to them, who would go about navigation all pages anyway!
Kindly comment if the code above solved your issue or not
Ammar Sajdi
Amman - Jordan -
How to declare Compound Foreign Key for CMR
Hi All,
I would like to know, is it possible to declare CMR field for Compound Foreign key.
Any Pointers would be appreicated.
Thanks
Ann.Compound foreign keys are declared (when the relationships are used) in the sun-cmp-mappings.xml file, like this:
<cmr-field-mapping>
<cmr-field-name>actividadePeriodos</cmr-field-name>
<column-pair>
<column-name>ACTIVIDADE.COD_PROJECTO</column-name>
<column-name>ACTIVIDADE_PERIODO.COD_PROJECTO</column-name>
</column-pair>
<column-pair>
<column-name>ACTIVIDADE.COD_ACTIVIDADE</column-name>
<column-name>ACTIVIDADE_PERIODO.COD_ACTIVIDADE</column-name>
</column-pair>
<fetched-with>
<none/>
</fetched-with>
</cmr-field-mapping>The declaration is done in the parent of the relationship. The other configurations (in sun-cmp-mappings, ejb-jar and the entity code) are just the same as for simple foreign keys.
If the existing database relationships are not used in the app server (if there is no need for composite containment between the parent and the child), then the foreign keys don't need to be declared. -
Eager Fetching recursivity bug
I have two classes A and B.
A has two relations to B.
A.theB1 (A 1-1 to B)
A.theB2 (A 1-n to B)
B has two relation to A.
B.theA1 (B 1-n to A)
B.theA2 (B 1-n to A)
If I configure A.theB1 and A.theB2 with default-fetch-group="true".
And then I Use Eager Fetching multiple:everything works fine.
But if I also configure B.theA1 and B.theA2 with
default-fetch-group="true".
And then I Use Eager Fetching multiple
I get this Exception:
java.lang.StackOverflowError
at java.util.TreeMap.access$400(TreeMap.java:77)
at java.util.TreeMap$EntryIterator.nextEntry(TreeMap.java:1024)
at java.util.TreeMap$KeyIterator.next(TreeMap.java:1047)
at java.util.TreeMap.buildFromSorted(TreeMap.java:1588)
at java.util.TreeMap.buildFromSorted(TreeMap.java:1576)
at java.util.TreeMap.buildFromSorted(TreeMap.java:1534)
at java.util.TreeMap.addAllForTreeSet(TreeMap.java:1492)
at java.util.TreeSet.addAll(TreeSet.java:247)
at kodo.jdbc.sql.AbstractSelect$JoinSet.<init>(AbstractSelect.java:1021)
at kodo.jdbc.sql.AbstractSelect.and(AbstractSelect.java:719)
at kodo.jdbc.sql.AbstractSelect.getJoins(AbstractSelect.java:541)
at kodo.jdbc.sql.AbstractSelect.select(AbstractSelect.java:229)
at kodo.jdbc.sql.AbstractSelect.select(AbstractSelect.java:221)
at
kodo.jdbc.runtime.JDBCStoreManager.selectBaseMappings(JDBCStoreManager.java:874)
at
kodo.jdbc.runtime.JDBCStoreManager.selectMappings(JDBCStoreManager.java:835)
at kodo.jdbc.runtime.JDBCStoreManager.access$000(JDBCStoreManager.java:30)
at
kodo.jdbc.runtime.JDBCStoreManager$SelectImpl.selectInternal(JDBCStoreManager.java:1071)
at kodo.jdbc.sql.AbstractSelect.select(AbstractSelect.java:259)
at
kodo.jdbc.meta.OneToOneFieldMapping.select(OneToOneFieldMapping.java:452)
at
kodo.jdbc.runtime.JDBCStoreManager.selectBaseMappings(JDBCStoreManager.java:909)
at
kodo.jdbc.runtime.JDBCStoreManager.selectMappings(JDBCStoreManager.java:835)
at kodo.jdbc.runtime.JDBCStoreManager.access$000(JDBCStoreManager.java:30)
at
kodo.jdbc.runtime.JDBCStoreManager$SelectImpl.selectInternal(JDBCStoreManager.java:1071)
at kodo.jdbc.sql.AbstractSelect.select(AbstractSelect.java:259)
at
kodo.jdbc.meta.OneToOneFieldMapping.select(OneToOneFieldMapping.java:452)
at
kodo.jdbc.runtime.JDBCStoreManager.selectBaseMappings(JDBCStoreManager.java:909)
at
kodo.jdbc.runtime.JDBCStoreManager.selectMappings(JDBCStoreManager.java:835)
at kodo.jdbc.runtime.JDBCStoreManager.access$000(JDBCStoreManager.java:30)
at
kodo.jdbc.runtime.JDBCStoreManager$SelectImpl.selectInternal(JDBCStoreManager.java:1071)
at kodo.jdbc.sql.AbstractSelect.select(AbstractSelect.java:259)
at
kodo.jdbc.meta.ManyToManyFieldMapping.load(ManyToManyFieldMapping.java:350)
at kodo.jdbc.runtime.JDBCStoreManager.load(JDBCStoreManager.java:427)
at
kodo.runtime.DelegatingStoreManager.load(DelegatingStoreManager.java:141)
at
kodo.datacache.DataCacheStoreManager.load(DataCacheStoreManager.java:386)
at
kodo.runtime.DelegatingStoreManager.load(DelegatingStoreManager.java:141)
at kodo.runtime.ROPStoreManager.load(ROPStoreManager.java:82)
at kodo.runtime.StateManagerImpl.loadFields(StateManagerImpl.java:2274)
at kodo.runtime.StateManagerImpl.load(StateManagerImpl.java:139)
at
kodo.runtime.PersistenceManagerImpl.load(PersistenceManagerImpl.java:2408)
at
kodo.runtime.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:1244)
at
kodo.runtime.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:1175)
at kodo.jdbc.runtime.JDBCStoreManager.load(JDBCStoreManager.java:677)
at kodo.jdbc.meta.OneToOneFieldMapping.load(OneToOneFieldMapping.java:481)
at kodo.jdbc.runtime.JDBCStoreManager.load(JDBCStoreManager.java:731)
at kodo.jdbc.runtime.JDBCStoreManager.load(JDBCStoreManager.java:720)
at kodo.jdbc.runtime.JDBCStoreManager.load(JDBCStoreManager.java:720)
at
kodo.jdbc.runtime.JDBCStoreManager.initialize(JDBCStoreManager.java:338)
at
kodo.runtime.DelegatingStoreManager.initialize(DelegatingStoreManager.java:134)
at
kodo.datacache.DataCacheStoreManager.initialize(DataCacheStoreManager.java:340)
at
kodo.runtime.DelegatingStoreManager.initialize(DelegatingStoreManager.java:134)
at kodo.runtime.ROPStoreManager.initialize(ROPStoreManager.java:57)
at
kodo.runtime.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:1240)
at
kodo.runtime.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:1175)
at kodo.jdbc.runtime.JDBCStoreManager.load(JDBCStoreManager.java:677)
at kodo.jdbc.meta.OneToOneFieldMapping.load(OneToOneFieldMapping.java:481)
at kodo.jdbc.runtime.JDBCStoreManager.load(JDBCStoreManager.java:731)
at
kodo.jdbc.runtime.JDBCStoreManager.initialize(JDBCStoreManager.java:338)
at
kodo.runtime.DelegatingStoreManager.initialize(DelegatingStoreManager.java:134)
at
kodo.datacache.DataCacheStoreManager.initialize(DataCacheStoreManager.java:340)
at
kodo.runtime.DelegatingStoreManager.initialize(DelegatingStoreManager.java:134)
at kodo.runtime.ROPStoreManager.initialize(ROPStoreManager.java:57)
I have test every combination and what I see ,is that the Exception comes
because "Eager Fetching" process works recursively.
I remmember the same problem with Top Link Batch Reading.
I don't know if this could help: but I see two solutions.
1) explicity option to work recursively or not.
2) limitate depth level of recursivity.
This is the configuration file:
javax.jdo.PersistenceManagerFactoryClass:
kodo.jdbc.runtime.JDBCPersistenceManagerFactory
javax.jdo.option.ConnectionDriverName: com.jnetdirect.jsql.JSQLDriver
javax.jdo.option.ConnectionUserName: sa
javax.jdo.option.ConnectionPassword:
javax.jdo.option.ConnectionURL:
jdbc:JSQLConnect://agarcia/database=kodo3/SelectMethod=cursor
javax.jdo.option.Optimistic: true
javax.jdo.option.RetainValues: true
javax.jdo.option.NontransactionalRead: false
kodo.ConnectionFactoryProperties: MaxCachedStatements=0
kodo.DataCacheClass: kodo.datacache.CacheImpl
kodo.DataCacheProperties: CacheSize=1000000
kodo.PersistenceManagerClass: kodo.runtime.PersistenceManagerImpl
kodo.QueryCacheProperties: CacheSize=10000
kodo.RemoteCommitProviderClass: kodo.event.SingleJVMRemoteCommitProvider
kodo.jdbc.DBDictionaryClass=kodo.jdbc.sql.SQLServerDictionary
kodo.jdbc.TransactionIsolation=
javax.jdo.option.Multithreaded: true
## Transaction ###
kodo.TransactionMode: managed
kodo.ManagedRuntimeClass: kodo.ee.JNDIManagedRuntime
kodo.ManagedRuntimeProperties:
TransactionManagerName=java:/TransactionManager
#kodo.jdbc.MappingFactoryClass: kodo.jdbc.meta.MetaDataMappingFactory
kodo.jdbc.DBDictionaryProperties: BatchLimit=0 JoinSyntax=sql92
kodo.EagerFetchMode: multiple
kodo.FetchBatchSize: 10000
kodo.FetchThreshold: -1Oh boy. Oops.
Thanks for the report.
-Patrick
On Fri, 01 Aug 2003 16:57:52 +0000, oscar wrote:
>
I have two classes A and B.
A has two relations to B.
A.theB1 (A 1-1 to B)
A.theB2 (A 1-n to B)
B has two relation to A.
B.theA1 (B 1-n to A)
B.theA2 (B 1-n to A)
If I configure A.theB1 and A.theB2 with default-fetch-group="true".
And then I Use Eager Fetching multiple:everything works fine.
But if I also configure B.theA1 and B.theA2 with
default-fetch-group="true".
And then I Use Eager Fetching multiple
I get this Exception:
java.lang.StackOverflowError
at java.util.TreeMap.access$400(TreeMap.java:77)
at java.util.TreeMap$EntryIterator.nextEntry(TreeMap.java:1024)
at java.util.TreeMap$KeyIterator.next(TreeMap.java:1047)
at java.util.TreeMap.buildFromSorted(TreeMap.java:1588)
at java.util.TreeMap.buildFromSorted(TreeMap.java:1576)
at java.util.TreeMap.buildFromSorted(TreeMap.java:1534)
at java.util.TreeMap.addAllForTreeSet(TreeMap.java:1492)
at java.util.TreeSet.addAll(TreeSet.java:247)
at kodo.jdbc.sql.AbstractSelect$JoinSet.<init>(AbstractSelect.java:1021)
at kodo.jdbc.sql.AbstractSelect.and(AbstractSelect.java:719)
at kodo.jdbc.sql.AbstractSelect.getJoins(AbstractSelect.java:541)
at kodo.jdbc.sql.AbstractSelect.select(AbstractSelect.java:229)
at kodo.jdbc.sql.AbstractSelect.select(AbstractSelect.java:221)
at
kodo.jdbc.runtime.JDBCStoreManager.selectBaseMappings(JDBCStoreManager.java:874)
at
kodo.jdbc.runtime.JDBCStoreManager.selectMappings(JDBCStoreManager.java:835)
at kodo.jdbc.runtime.JDBCStoreManager.access$000(JDBCStoreManager.java:30)
at
kodo.jdbc.runtime.JDBCStoreManager$SelectImpl.selectInternal(JDBCStoreManager.java:1071)
at kodo.jdbc.sql.AbstractSelect.select(AbstractSelect.java:259)
at
kodo.jdbc.meta.OneToOneFieldMapping.select(OneToOneFieldMapping.java:452)
at
kodo.jdbc.runtime.JDBCStoreManager.selectBaseMappings(JDBCStoreManager.java:909)
at
kodo.jdbc.runtime.JDBCStoreManager.selectMappings(JDBCStoreManager.java:835)
at kodo.jdbc.runtime.JDBCStoreManager.access$000(JDBCStoreManager.java:30)
at
kodo.jdbc.runtime.JDBCStoreManager$SelectImpl.selectInternal(JDBCStoreManager.java:1071)
at kodo.jdbc.sql.AbstractSelect.select(AbstractSelect.java:259)
at
kodo.jdbc.meta.OneToOneFieldMapping.select(OneToOneFieldMapping.java:452)
at
kodo.jdbc.runtime.JDBCStoreManager.selectBaseMappings(JDBCStoreManager.java:909)
at
kodo.jdbc.runtime.JDBCStoreManager.selectMappings(JDBCStoreManager.java:835)
at kodo.jdbc.runtime.JDBCStoreManager.access$000(JDBCStoreManager.java:30)
at
kodo.jdbc.runtime.JDBCStoreManager$SelectImpl.selectInternal(JDBCStoreManager.java:1071)
at kodo.jdbc.sql.AbstractSelect.select(AbstractSelect.java:259)
at
kodo.jdbc.meta.ManyToManyFieldMapping.load(ManyToManyFieldMapping.java:350)
at kodo.jdbc.runtime.JDBCStoreManager.load(JDBCStoreManager.java:427)
at
kodo.runtime.DelegatingStoreManager.load(DelegatingStoreManager.java:141)
at
kodo.datacache.DataCacheStoreManager.load(DataCacheStoreManager.java:386)
at
kodo.runtime.DelegatingStoreManager.load(DelegatingStoreManager.java:141)
at kodo.runtime.ROPStoreManager.load(ROPStoreManager.java:82)
at kodo.runtime.StateManagerImpl.loadFields(StateManagerImpl.java:2274)
at kodo.runtime.StateManagerImpl.load(StateManagerImpl.java:139)
at
kodo.runtime.PersistenceManagerImpl.load(PersistenceManagerImpl.java:2408)
at
kodo.runtime.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:1244)
at
kodo.runtime.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:1175)
at kodo.jdbc.runtime.JDBCStoreManager.load(JDBCStoreManager.java:677)
at kodo.jdbc.meta.OneToOneFieldMapping.load(OneToOneFieldMapping.java:481)
at kodo.jdbc.runtime.JDBCStoreManager.load(JDBCStoreManager.java:731)
at kodo.jdbc.runtime.JDBCStoreManager.load(JDBCStoreManager.java:720)
at kodo.jdbc.runtime.JDBCStoreManager.load(JDBCStoreManager.java:720)
at
kodo.jdbc.runtime.JDBCStoreManager.initialize(JDBCStoreManager.java:338)
at
kodo.runtime.DelegatingStoreManager.initialize(DelegatingStoreManager.java:134)
at
kodo.datacache.DataCacheStoreManager.initialize(DataCacheStoreManager.java:340)
at
kodo.runtime.DelegatingStoreManager.initialize(DelegatingStoreManager.java:134)
at kodo.runtime.ROPStoreManager.initialize(ROPStoreManager.java:57)
at
kodo.runtime.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:1240)
at
kodo.runtime.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:1175)
at kodo.jdbc.runtime.JDBCStoreManager.load(JDBCStoreManager.java:677)
at kodo.jdbc.meta.OneToOneFieldMapping.load(OneToOneFieldMapping.java:481)
at kodo.jdbc.runtime.JDBCStoreManager.load(JDBCStoreManager.java:731)
at
kodo.jdbc.runtime.JDBCStoreManager.initialize(JDBCStoreManager.java:338)
at
kodo.runtime.DelegatingStoreManager.initialize(DelegatingStoreManager.java:134)
at
kodo.datacache.DataCacheStoreManager.initialize(DataCacheStoreManager.java:340)
at
kodo.runtime.DelegatingStoreManager.initialize(DelegatingStoreManager.java:134)
at kodo.runtime.ROPStoreManager.initialize(ROPStoreManager.java:57)
I have test every combination and what I see ,is that the Exception comes
because "Eager Fetching" process works recursively.
I remmember the same problem with Top Link Batch Reading.
I don't know if this could help: but I see two solutions.
1) explicity option to work recursively or not.
2) limitate depth level of recursivity.
This is the configuration file:
javax.jdo.PersistenceManagerFactoryClass:
kodo.jdbc.runtime.JDBCPersistenceManagerFactory
javax.jdo.option.ConnectionDriverName: com.jnetdirect.jsql.JSQLDriver
javax.jdo.option.ConnectionUserName: sa
javax.jdo.option.ConnectionPassword:
javax.jdo.option.ConnectionURL:
jdbc:JSQLConnect://agarcia/database=kodo3/SelectMethod=cursor
javax.jdo.option.Optimistic: true
javax.jdo.option.RetainValues: true
javax.jdo.option.NontransactionalRead: false
kodo.ConnectionFactoryProperties: MaxCachedStatements=0
kodo.DataCacheClass: kodo.datacache.CacheImpl
kodo.DataCacheProperties: CacheSize=1000000
kodo.PersistenceManagerClass: kodo.runtime.PersistenceManagerImpl
kodo.QueryCacheProperties: CacheSize=10000
kodo.RemoteCommitProviderClass: kodo.event.SingleJVMRemoteCommitProvider
kodo.jdbc.DBDictionaryClass=kodo.jdbc.sql.SQLServerDictionary
kodo.jdbc.TransactionIsolation=
javax.jdo.option.Multithreaded: true
## Transaction ###
kodo.TransactionMode: managed
kodo.ManagedRuntimeClass: kodo.ee.JNDIManagedRuntime
kodo.ManagedRuntimeProperties:
TransactionManagerName=java:/TransactionManager
#kodo.jdbc.MappingFactoryClass: kodo.jdbc.meta.MetaDataMappingFactory
kodo.jdbc.DBDictionaryProperties: BatchLimit=0 JoinSyntax=sql92
kodo.EagerFetchMode: multiple
kodo.FetchBatchSize: 10000
kodo.FetchThreshold: -1--
Patrick Linskey
SolarMetric Inc. -
Hi,
I am using eager fetch in Kodo 3.1.3 but not sure if my configuration is
correct.
I have a Report object which contains a collection of Memos objects. It
is a 1-to-many relationship. After configure the kodo.properties and the
mapping file as following:
kodo.properties:
Add the following line
kodo.EagerFetchMode: multiple
kodo.Log: SQL=TRACE
In mapping jdo:
<class name="Report" objectid-class="ReportId">
<field name="memo" default-fetch-group="true">
<collection element-type="Memo"/>
</field>
<field name="policyId" primary-key="true"/>
</class>
After making those changes, running my application against the database
with say 100 reports, the SQL trace still showing 100 SQL statement rather
than 1 single SELECT as I understand, ie. select all 100 reports and all
associated memos in one visit to the db server.
Please correct me if I am worng. Thanks.
Cheers,
DienHi,
I am using eager fetch in Kodo 3.1.3 but not sure if my configuration is
correct.
I have a Report object which contains a collection of Memos objects. It
is a 1-to-many relationship. After configure the kodo.properties and the
mapping file as following:
kodo.properties:
Add the following line
kodo.EagerFetchMode: multiple
kodo.Log: SQL=TRACE
In mapping jdo:
<class name="Report" objectid-class="ReportId">
<field name="memo" default-fetch-group="true">
<collection element-type="Memo"/>
</field>
<field name="policyId" primary-key="true"/>
</class>
After making those changes, running my application against the database
with say 100 reports, the SQL trace still showing 100 SQL statement rather
than 1 single SELECT as I understand, ie. select all 100 reports and all
associated memos in one visit to the db server.
Please correct me if I am worng. Thanks.
Cheers,
Dien -
BLOB lazy fetch problem.. SOMEONE HELPS !
Well... Toplink essentials ignores the lazy fetch flag from my entity class. Why is that ?
Will toplink (non-essentials) ignore it ?
How can I deal with this issue ?lazy on Basic, (actually in general) is an option part of the JPA specification (a hint actually), so TopLink Essentials did not support lazy on Basic (only on relationships).
EclipseLink 1.0 does support this (as long as you use the weaving agent). It also supports fetch groups beyond the JPA specification.
A solution without lazy is to move the LOB into another object and define a lazy 1-1 to this object. This is normally a good idea with large LOBs in general, even with lazy support.
-- James : http://www.eclipselink.org
Maybe you are looking for
-
I'm having problems with iPhoto and the facebook set-up. Every time I attempt to do so it says an error has occured and try again later. I have not seen a solution posted. Therefore, how does one contact Apple to solve the problem? I'm new to the
-
Where is default icons location in oracle form 10g
hi, Can anybody please tell me, where is the default(given below) icons location in oracle form 10g. I want to user that icons in my form. Image: !c:\icons.gif! thanks mohan
-
MySQL ODBC driver (32 bit) linked server, architecture mismatch
Hello, I am trying to create a linked server in SQL 2012 Management Studio with a MySQL external server. I have used the 32bit ODBC driver as instructed by the developer, following this rule: To manage a data source that connects to a 32-bit driver u
-
Map the user exit variables with the queries/cubes using them
Hello Friends, What are the post unicode conversion tests that you can perform on front end/existing queries? is there any added advantage for queries due to unicode? is testing the working of variable enough? is there any table to map the user exit
-
When synchronize, the hour delayed...
When connecting my IPad 1 (IOS 4.3.5) with my Macbook (OX s 10.5.8) by USB, in IPad the hour delayed one hour. And when I sync ICal using ITunes (latest version), the events are copied at different time on both devices. For example, if the event in I