Lazy loading loads eager anyway ?

Hello,
I read in some articles and books that the lazy loading in EJB 3.0 is just a hint, in the sence that the persistence manager could decide to load eager, even if lazy configured.
Is this correct, or will the default lazy loading always only fetch when asked ?
C.

This is true in the JPA Spec, i.e. meaning that supporting lazy loading is "optional" not required by the JPA Spec.
However TopLink does support lazy loading. By default any @OneToMany or @ManyToMany mappings are lazy and will not be fetched until accessed. By default in the JPA Spec @OneToOne and @ManyToOne are not lazy, but if you set them to be lazy then TopLink will also support this, as long as you enable weaving (weaving is not require for @ToManys). I would recommend you always make your @OneToOne and @ManyToOne lazy. Weaving in TopLink can be enable either through using the TopLink agent when launching your Java VM, or is used automatically in OracleAS or Glassfish, or through using the TopLink static weaving ant task.
In TopLink Essentials lazy on @Basic mappings is not supported, however this will be supported in TopLink 11g.

Similar Messages

  • Facing problem with lazy loading in ejb3.0

    The following error is coming up when i try to access the collection in the entity entity bean. i am using entitymanager.find() to retrieve the entity. intial set of values are coming fine but when try to access the collection in the entity the error is coming up. one solution is to make the fetch type=eager. but can we do lazy loading with out any problem. the following is the error. kindly help me in this. do i need to do anything extra that mean have to add any annotations or anything.
    org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.lucid.erp.entities.EmployeeDTO.addresses, no session or session was closed
         at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
         at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
         at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343)
         at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
         at org.hibernate.collection.PersistentBag.get(PersistentBag.java:422)
         at com.lucidlabs.erp.actions.EmployeeAction.view(EmployeeAction.java:20)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)
         at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)
         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)
         at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
         at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)
         at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
         at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:184)
         at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         at

    this is transactions 101 material. Do you know about transactions and how they work? Do you know about managed entities?
    The problem you are having is that the addresses are accessed outside of the transaction in which the entity was fetched. That means there is no more database session and thus the lazy fetch cannot work. If you really need the addresses, you can at least force fetch them by calling getAddresses().size() right after you fetch the entity from the database; assuming that the transaction is still active at that point.

  • 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

  • Java and lazy loading

    Hello all!
    I have three question regarding lazy loading:
    Question one: Can it be said that java works by lazy loading by default?
    Question two: What is the opposite of lazy loading?
    Question three: How can I change this default behavior to the opposite of lazy loading?
    Thanks in advance,
    Julien.

    1. Yes.
    2. Eager loading.
    3. You can't. You can get a half-decent approximation using a suitable classloader, though. After defining your class, you parse the string table and load the classes referred to therein. BCEL may useful for the parsing.

  • Equals and lazy loading

    Hi all,
    We have an application in which we use lazy loading on our client, so we can't be sure that both objects have the same objects reference loaded already. While implementing the equals method I came to the problem if it makes sense to compare the lazy loaded objects as well, because this might lead to a very deep object comparison through the whole object tree which might be very unperformant if I load this references on demand. Otherwise not comparing the references might be an incomplete comparision of these objects and makes the usage of the equals method very difficult.
    Has anyone experience using the equals method with lazy loading?
    Thanks in advance
    Marco

    Okay - here comes a little more detail about our architecture to give you a deeper understanding. Currently we are working with EJB3 / JBoss environment but our intention is to encapsulate this through a DAO-layer. Anyways we have special object-dependencies as per example a customer has it�s orders. So in my understanding a customer with the an address, a name etc. with NO orders is not the same as a customer with the same address and the same name and let�s say 2 orders. So I can stick with comparing simply the name and the address, but this wouldn�t give you an exact comparison.
    The other way would be to compare the orders as well, but what if the orders have a number of invoices behind them. The conclusion would be, that I�d have to compare them as well. Additionally I have the problem, that I have totally equal customers with the same number of orders and invoices, but the first one has a null-value in its orders, because they have not been loaded from database yet and the other one has. So my technique with comparing the lazy-loaded references would not work here. A complete loading of all references for a comparison cannot be the solution here either.
    So it is hard to say if they are I/O intensive. Worst case would be, that we have to load the complete object-tree for comparison from database and send them between client and server (jboss). This is part of our question? Should this be the consequence of lazy loading or is it best pratice to stick with the local attributes and let the client do the work, so that he has to work through the whole object-tree if he wants to know the exact equality.
    Does this give you a more detailled view of our question? I guess I am not the first to deal with this problem, so I�d like to share your experiences with you about what is "wise" to do.
    Thanks for your help
    Marco

  • Toplink JPA LAZY loading in Java SE works without javaagent?

    hi there,
    I tought that mappings like
    @JoinColumn(name = "join_col_name")
    @ManyToOne(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
    private RelatedObject relObj;
    with TopLink JPA in Java SE environment works ONLY with the
    -javaagent:toplink-essentials-agent.jar
    JVM parameter?
    the strange thing is: I did 2 test runs, with and without the java agent parameter. I also could see that in the first case the weaver is working, in the second the property "toplink.weaving=false" is printed to the console BUT if I access the LAZY mapped attribute of the object instance it works in both cases - I expected a NullPointerEx. in the case without the javaagent.
    Is there anything I missed?
    Hans

    Chris,
    thank for for the tip about verifying lazy or eager fetching. The results are interesting - or better: confusing - to me:
    I have built a test project with 3 entities:
    Entity A hast @OneToMany to Entity B and
    Entity B has ManyToONe to Entity C
    A <-- B --> C
    ALL relations are marked with FetchType.LAZY in all directions.
    When I simply run the test project via main()-method out of eclipse, WITHTOUT specifycing a -javaagent parameter in the run dialog, I can confirm using your test case that the realtion IS LAZILY FETCHED.
    So, I do not really know how this should work without the javaagent.
    You mentioned statically weaved classed - is this the default case when no agent is present, how is it done? Toplink logging says that weaving is NOT active:
    ServerSession(16821027)--Thread(Thread[main,5,main])--property=toplink.weaving; value=false
    so how can the lazy loading work then?
    regards,
    Hans

  • OC4J CMP lazy-loading failure

    Hi,<br>
    Been looking at the latest production release of oc4j and have been playing with the demo cmp ejb program provided by the download (dir : \j2ee\homedemo\ejb\cmp). I've also installed p6Spy to see the SQL commands sent to the database by the container. Even though i've set the lazy-loading="false" on the orion-ejb.xml file I still seem to be getting multiple select statements one to retrieve the primary key's and then multiple to retrieve each of the records, which I thought lazy loading set to false should fix, anyway changed the lazy-loading="true" and got the same results. So does the lazy-loading attrib on <finder-method> actually do anything??
    <br>
    cheers
    <br>
    <br>
    <font size=1>
    1129312695737|731|0|statement|SELECT e.empNo FROM EmployeeBean_cmpexample_aqm15f e |SELECT e.empNo FROM EmployeeBean_cmpexample_aqm15f e
    <br><br>1129312695807|-1||resultset|SELECT e.empNo FROM EmployeeBean_cmpexample_aqm15f e |EMPNO = 73305<br>
    <br><br>1129312695807|-1||resultset|SELECT e.empNo FROM EmployeeBean_cmpexample_aqm15f e |EMPNO = 71
    <br><br>1129312696458|641|0|statement|select EmployeeBean_cmpexample_aqm15f.empName, EmployeeBean_cmpexample_aqm15f.salary from EmployeeBean_cmpexample_aqm15f where (EmployeeBean_cmpexample_aqm15f.empNo = ?)|select EmployeeBean_cmpexample_aqm15f.empName, EmployeeBean_cmpexample_aqm15f.salary from EmployeeBean_cmpexample_aqm15f where (EmployeeBean_cmpexample_aqm15f.empNo = 73305)
    <br><br>1129312697099|631|0|statement|select EmployeeBean_cmpexample_aqm15f.empName, EmployeeBean_cmpexample_aqm15f.salary from EmployeeBean_cmpexample_aqm15f where (EmployeeBean_cmpexample_aqm15f.empNo = ?)|select EmployeeBean_cmpexample_aqm15f.empName, EmployeeBean_cmpexample_aqm15f.salary from EmployeeBean_cmpexample_aqm15f where (EmployeeBean_cmpexample_aqm15f.empNo = 73305)
    <br><br>1129312697760|661|0|statement|select EmployeeBean_cmpexample_aqm15f.empName, EmployeeBean_cmpexample_aqm15f.salary from EmployeeBean_cmpexample_aqm15f where (EmployeeBean_cmpexample_aqm15f.empNo = ?)|select EmployeeBean_cmpexample_aqm15f.empName, EmployeeBean_cmpexample_aqm15f.salary from EmployeeBean_cmpexample_aqm15f where (EmployeeBean_cmpexample_aqm15f.empNo = 73305)
    <br><br>1129312699413|1643|0|statement|select EmployeeBean_cmpexample_aqm15f.empName, EmployeeBean_cmpexample_aqm15f.salary from EmployeeBean_cmpexample_aqm15f where (EmployeeBean_cmpexample_aqm15f.empNo = ?)|select EmployeeBean_cmpexample_aqm15f.empName, EmployeeBean_cmpexample_aqm15f.salary from EmployeeBean_cmpexample_aqm15f where (EmployeeBean_cmpexample_aqm15f.empNo = 71)
    <br><br>1129312700074|651|0|statement|select EmployeeBean_cmpexample_aqm15f.empName, EmployeeBean_cmpexample_aqm15f.salary from EmployeeBean_cmpexample_aqm15f where (EmployeeBean_cmpexample_aqm15f.empNo = ?)|select EmployeeBean_cmpexample_aqm15f.empName, EmployeeBean_cmpexample_aqm15f.salary from EmployeeBean_cmpexample_aqm15f where (EmployeeBean_cmpexample_aqm15f.empNo = 71)
    <br><br>1129312700745|671|0|statement|select EmployeeBean_cmpexample_aqm15f.empName, EmployeeBean_cmpexample_aqm15f.salary from EmployeeBean_cmpexample_aqm15f where (EmployeeBean_cmpexample_aqm15f.empNo = ?)|select EmployeeBean_cmpexample_aqm15f.empName, EmployeeBean_cmpexample_aqm15f.salary from EmployeeBean_cmpexample_aqm15f where (EmployeeBean_cmpexample_aqm15f.empNo = 71)
    </font>

    Figured it out... Changed the CMT setting for the beans from Supports to Required seemed to resolve the problem.... <br>
    The ejb documentation for oc4j does say that CMR beans must be in a transaction (Supports,Never, NOT_REQUIRED) so maybe oracle should make sure the examples that ship with oc4j follow their own rules...

  • Toplink.weaving=true gives PersistenceException; for Lazy Loading config.

    I could use some help configuring my persistence.xml file, trying to make sure Lazy loading is configured properly. What I see in the logs normally is that Toplink defaults to Eager fetching on my JPA objects. So according to
    http://www.oracle.com/technology/products/ias/toplink/JPA/essentials/toplink-jpa-extensions.html
    I need to set toplink.weaving=true in persistence.xml, however I get the Exception below when I make the call to get the EntityManager for the first time.
    I'm using OC4J standalone 10.1.3.3 with JDK 1.5.0_13 and the latest Toplink (as you can see in the stack trace below). An excerpt from my persistence.xml is below that.
    Caused by: Exception [TOPLINK-30005] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException
    Exception Description: An exception was thrown while searching for persistence archives with ClassLoader: xyx-dal-webservice.root:0.0.0
    Internal Exception: javax.persistence.PersistenceException: Exception [TOPLINK-28020] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exc
    eptions.EntityManagerSetupException
    Exception Description: Value [true] for the property [toplink.weaving] is incorrect when global instrumentation is null, value should either be null or false. at oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException.exceptionSearchingForPersistenceResources(PersistenceUnitLoadingException.java:143)
    at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory(EntityManagerFactoryProvider.java:169)
    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:59)
    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:48)
    at gov.dhs.visit.ident.dal.jpa.entity.cvt.util.EntityManagerHelper.<clinit>(EntityManagerHelper.java:20)
    ... 43 more
    Caused by: javax.persistence.PersistenceException: Exception [TOPLINK-28020] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.E
    ntityManagerSetupException
    Exception Description: Value [true] for the property [toplink.weaving] is incorrect when global instrumentation is null, value should either be null or false.
    at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.callPredeploy(JavaSECMPInitializer.java:151)
    at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initPersistenceUnits(JavaSECMPInitializer.java:239)
    at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initialize(JavaSECMPInitializer.java:255)
    at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory(EntityManagerFactoryProvider.java:155)
    ... 46 more
    Caused by: Exception [TOPLINK-28020] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.EntityManagerSetupException
    Exception Description: Value [true] for the property [toplink.weaving] is incorrect when global instrumentation is null, value should either be null or false.
    at oracle.toplink.essentials.exceptions.EntityManagerSetupException.wrongWeavingPropertyValue(EntityManagerSetupException.java:244)
    ... 50 more
    SEVERE: Caught exception while handling request: oracle.oc4j.rmi.OracleRemoteException: java.lang.ExceptionInInitializerError; nested exception is:
    java.lang.ExceptionInInitializerError oracle.oc4j.rmi.OracleRemoteException: java.lang.ExceptionInInitializerError; nested exception is:
    java.lang.ExceptionInInitializerError
    persistence.xml
      <persistence-unit name="PUName" transaction-type="JTA">
         <provider>oracle.toplink.essentials.PersistenceProvider</provider>
              <jta-data-source>jdbc/mydb</jta-data-source>
    <class>....a whole lotta JPA classes...</class>
        <properties>
             <property name="toplink.logging.level" value="FINE" />
             <property name="toplink.logging.timestamp" value="true"/>
               <property name="toplink.target-database" value="Oracle"/>
               <property name="toplink.target-server" value="OC4J_10_1_3" />
               <property name="toplink.weaving" value="true"/>
                    <property name="toplink.cache.shared.default" value="false"/>
        </properties>
      </persistence-unit>

    This error confuses me...
    Exception [TOPLINK-30005] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException
    Exception Description: An exception was thrown while searching for persistence archives with ClassLoader: sun.misc.Launcher$AppClassLoader@11b86e7
    Internal Exception: javax.persistence.PersistenceException: Exception [TOPLINK-28020] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.EntityManagerSetupException
    Exception Description: Value [true] for the property [toplink.weaving] is incorrect when global instrumentation is null, value should either be null or false.
         at oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException.exceptionSearchingForPersistenceResources(PersistenceUnitLoadingException.java:143)
         at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory(EntityManagerFactoryProvider.java:169)
         at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:110)I'm using TopLink from regular ol' Java SE (not container managed environment).
    http://www.oracle.com/technology/products/ias/toplink/JPA/essentials/toplink-jpa-extensions.html gives some hints, though, especially if you're operating outside of a container (seems like you gotta weave yourself). See http://www.oracle.com/technology/products/ias/toplink/JPA/essentials/toplink-jpa-extensions.html#LazyLoading
    Seems the command-line arg "-javaagent:toplink-essentials-agent.jar" is critical if you're running outside a container.

  • I don't understand lazy loading

    Could someone please help me understand lazy loading...
    I have a simple ORM model where Users have a OneToMany mapping to providers...
    But when I run
    public Users getUser(Long id){
    Users u = em.find(Users.class, id);
    List pu = u.getProviderUsers();
    System.out.println( pu );
    return u;
    I get "{IndirectList: not instantiated}" ... How do I control the population of List when I need it but leave it lazy when I don't. If I change it to EAGER fetch it works but performance slows down when I get a list of 20 users.

    The message "IndirectList: not instantiated" is not an error message. It happens when a toString() is invoked on a indirect collection.
    Following thread will clarify the issue further
    IndirectList: not instantiated

  • Serializing an entity with lazy loaded relationships

    Cross-posted from http://forum.java.sun.com/thread.jspa?threadID=793605
    Started to think I posted to the wrong forum.
    Is it possible to use FetchType.LAZY when sending an entity (let's say Person) to a remote client? I'm fine with the fact that a call like person.getAddress() would have to return null or throw an exception of some sort. But, is it possible to even send the Person object when using lazy fetching?

    I have tried, unsuccessfully. The reason I posted this question is that I don't have the experience to know if my failure is due to the goal being impossible or just do to a mistake I made. So, telling me to try doesn't help answer my question. So let me restate...
    Can YOU serialize an entity (sending it to a remote client) even though the entity has lazy-loaded relationships? I know that I cannot.
    Everything I have read implies that it is possible. However, I have been unable to pull this off using NB 5.5 and the Sun App Serv 9.0. If I make the relationships FetchType.EAGER, everything works. Using FetchType.LAZY, I can't even send the entity to the client, EVEN IF the client doesn't do anything with the entity.

  • Problem with module lazy loading in flex 3

    Hi every body!
    I have some problems with Module lazy loading. I am using flex 3.5, Module-flex3-0.14, parsley 3.2.
    I can't get the LazyModuleLoadPolicy working correctly.
    In my main application (the one that loads the modules), my parsley context is the following:
            <cairngorm:LazyModuleLoadPolicy objectId="lazyLoadPolicy" type="{ OpenViewMessage }" />
         <cairngorm:ModuleMessageInterceptor type="{ OpenViewMessage }"/>
         <cairngorm:ParsleyModuleDescriptor objectId="test"
              url="TestModule.swf"
              applicationDomain="{ClassInfo.currentDomain}"
         />
    And to load my module:
    [Inject(id="test")]
    [Bindable] public var test:IModuleManager;
    <core:LazyModulePod
         id="moduleLoader"
         moduleManager="{test}"
         moduleId="testModule"
    />
    with  LazyModulePod.mxml:
    <mx:Canvas
        xmlns:mx="http://www.adobe.com/2006/mxml"
        xmlns:module="com.adobe.cairngorm.module.*"
        xmlns:parsley="http://www.spicefactory.org/parsley">
        <mx:Script>
            <![CDATA[
                import com.adobe.cairngorm.module.ILoadPolicy;
                import com.adobe.cairngorm.module.IModuleManager;
                [Bindable]
                public var moduleId:String;
                [Bindable]
                public var moduleManager:IModuleManager;
                [Bindable]
                [Inject(id="lazyLoadPolicy")]
                public var lazyLoadPolicy:ILoadPolicy;
            ]]>
        </mx:Script>
        <parsley:Configure/>
        <module:ViewLoader id="moduleLoader"
            moduleId="{ moduleId }"
            moduleManager="{ moduleManager }"
            loadPolicy="{lazyLoadPolicy}">
             <!--<module:loadPolicy>
                  <module:BasicLoadPolicy/>
             </module:loadPolicy>-->
        </module:ViewLoader>
    </mx:Canvas>
    OpenViewMessage.as in a swc:
    public class OpenViewMessage
            private var _moduleId:String;
            private var _viewId:String;
            public function OpenViewMessage(moduleId:String, viewId:String)
                this._moduleId = moduleId;
                this._viewId = viewId;
            public function get viewId():String{
                return _viewId;
            [ModuleId]
            public function get moduleId():String
                return _moduleId;
    In another flex project, my module context is:
    <mx:Object
         xmlns:mx="http://www.adobe.com/2006/mxml"
         xmlns:controler="com.cegedim.myit.controler.*">
         <controler:WindowControler/>
    </mx:Object>
    The module implements IParsleyModule
    <mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
         implements="com.adobe.cairngorm.module.IParsleyModule"
         xmlns:spicefactory="http://www.spicefactory.org/parsley">
         <mx:Script>
              <![CDATA[
                   import org.spicefactory.parsley.flex.FlexContextBuilder;
                   import com.adobe.cairngorm.module.IParsleyModule;
                   public function get contextBuilder():ContextBuilderTag
                    return contextBuilderTag;
              ]]>
         </mx:Script>
         <spicefactory:ContextBuilder  id="contextBuilderTag" config="{ MyITTestModuleContext }"/>
         <spicefactory:Configure/>
    </mx:Module>
    and the WindowControler:
    public class WindowControler
         public function WindowControler(){}
         [Init]
            public function initialize():void
                Alert.show("Module Initialized");
            [MessageHandler(scope="local")]
            public function openViewMessageHandler(message:OpenViewMessage):void
                Alert.show("Opening view " + message.viewId + " in the module " + message.moduleId);
    If i uncomment the basicLoadPolicy in LazyModulePod.mxml and remove the lazyModuleLoadPolicy, everything works fine. The module is loaded when it's added to stage and it receives correctly messages dispatched to it. But with the lazy policy the module never loads.
    I may have missed something or there is somthing i don't understand because i tried the ModuleTest provided in example in cairngorm sources. It works fine (i mean loading the moduleA2 when receiving a message), but if i replace the change the lazyModulePolicy to listen to broadcasted messages instead of a pingMessage, the module never loads too.
        <cairngorm:LazyModuleLoadPolicy objectId="lazyLoadPolicy" type="{ BroadcastMessage }" />
        <cairngorm:ModuleMessageInterceptor
            type="{ BroadcastMessage }" moduleRef="moduleA" />
    public class BroadcastMessage
        public function BroadcastMessage()
    If someone has any clue, i'll be happy to test it =)
    Thanks.

    Hello, back on my issue, i tested a little bit more the message dispaching.
    I read the lazyLoadPolicy class and noticed that it always has to have a ModuleId property in the message to work, that's why the broadcast message didn't work to awake the module with the lazy loading policy.
    So i added copy of my module:
         <cairngorm:ParsleyModuleDescriptor objectId="test"
              url="TestModule.swf"
              applicationDomain="{ClassInfo.currentDomain}"
         />
         <cairngorm:ParsleyModuleDescriptor objectId="testbis"
              url="TestModuleBis.swf"
              applicationDomain="{ClassInfo.currentDomain}"
         />     
    Set them both with a basicLoadPolicy, and tries to dispatch a message to only one of them using the ModuleId metatag. I then noticed that both modules received the message and not only the one i expected.
    I then changed the ModuleMessageInterceptor configuration to dispatch to only one kind of module:
    <cairngorm:ModuleMessageInterceptor type="{ OpenViewMessage }" moduleRef="test"/>
    and this worked as expected. Only the first module catched the message. I am obiously messing with the ModuleId metatag but i cannot see what's wrong...
    I compiled with
    -keep-as3-metadata+=ModuleId
    but this hasn't changed anything...

  • It doesn�t work lazy loading with remote client (toplink)

    I am trying to use lazy loading in a @ManyToOne field but I get an exception. I have been reading in some oracle tutorials that it's necesary use -javaagent:.../lib/toplink-essentials-agent.jar for that it works because this argument activate dynamic weaving in JavaSE. I have put this command line argument javaagent but it doesn't work. Why? Can I have to do another thing? I have done a lot of tests in base to comments read in another forums but I only obtains an exception.
    Caused by: java.io.IOException: Mismatched serialization UIDs
    NOTE: The server use toplink and the remote client query the entitties through a session bean of the server. Besides, I am using Glassfish (Sun application server and toplink).
    Thanks in advance.
    hayken

    At first, thank you for your reply.
    I know that I haven´t explained the problem too well. I have a stateless bean with one remote method that execute a query an returns an entity like this
    @Entity
    public class ModuloEntity extends Serializable
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long idModulo;
    private String nombre;
    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="IdProyecto")
    private ProyectoEntity proyecto;
    The remote client invoke this method and in that moment I get this exception.
    21-may-2007 18:55:48 com.sun.corba.ee.impl.encoding.CDRInputStream_1_0 read_value
    ADVERTENCIA: "IOP00810211: (MARSHAL) Exception from readValue on ValueHandler in CDRInputStream"
    org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 211 completed: Maybe
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.valuehandlerReadException(ORBUtilSystemException.java:7053)
    Caused by: java.io.IOException: Mismatched serialization UIDs : Source (Rep. IDRMI:com.syskonic.gesplan.entities.ModuloEntity:6D06A8C14D488FFF:8E6FC8687EA9E512) = 8E6FC8687EA9E512 whereas Target (Rep. ID RMI:com.syskonic.gesplan.entities.ModuloEntity:1C6925798CDFD3DF:3455DBF4457AE337) = 3455DBF4457AE337
    at com.sun.corba.ee.impl.util.RepositoryId.useFullValueDescription(RepositoryId.java:573)
    If I look the server log, I can see that the call has not been produced, it doesn´t show any exception. It looks that the object managed by the server and the remote client aren´t the same and the corba service doesn´t work when remote client call session method. If I change the ModuloEntity and remove the fetch attribute then all this process executes correctly. The problem is in this attribute.
    NOTE: I am using the javaagent command line argument.
    Hayken

  • ConcurrentModificationException - concurrent requests while lazy loading a relationship without server warmup

    Hello,
    We are running into a ConcurrentModificationException when we are firing 100 concurrent requests without warming up the server.
    Looks like the error is coming up when a a relationship is  being lazy loaded.
    We are seeing this behavior consistently. Once the server is warmed up, we are not seeing any issues under concurrency.
    I am attaching the two DAOs that are related to the issue.
    ExtensionPointRulesetDAO has a M:1 relationship with RuleSetEntityDAO and we are getting the error when ExtensionPointRuleSetDAO._persistence_get_ruleSetEntity() is called.
    2015-02-13 12:14:24,021 ERROR [uimadmin] [[ACTIVE] ExecuteThread: '11' for queue: 'weblogic.kernel.Default (self-tuning)'] [ExtensionRuleMediator] [INV-180012] Failed to retrieve the extension point ruleset: null.
    java.util.ConcurrentModificationException
        at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:859)
        at java.util.ArrayList$Itr.next(ArrayList.java:831)
        at org.eclipse.persistence.internal.databaseaccess.ParameterizedSQLBatchWritingMechanism.executeBatchedStatements(ParameterizedSQLBatchWritingMechanism.java:134)
        at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:574)
        at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:535)
        at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:1717)
        at org.eclipse.persistence.sessions.server.ClientSession.executeCall(ClientSession.java:253)
        at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:207)
        at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193)
        at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectOneRow(DatasourceCallQueryMechanism.java:666)
        at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectOneRowFromTable(ExpressionQueryMechanism.java:2656)
        at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectOneRow(ExpressionQueryMechanism.java:2627)
        at org.eclipse.persistence.queries.ReadObjectQuery.executeObjectLevelReadQuery(ReadObjectQuery.java:450)
        at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1081)
        at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:844)
        at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1040)
        at org.eclipse.persistence.queries.ReadObjectQuery.execute(ReadObjectQuery.java:418)
        at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1128)
        at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2871)
        at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1516)
        at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1498)
        at org.eclipse.persistence.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:98)
        at org.eclipse.persistence.internal.indirection.QueryBasedValueHolder.instantiateForUnitOfWorkValueHolder(QueryBasedValueHolder.java:113)
        at org.eclipse.persistence.internal.indirection.UnitOfWorkValueHolder.instantiateImpl(UnitOfWorkValueHolder.java:156)
        at org.eclipse.persistence.internal.indirection.UnitOfWorkValueHolder.instantiate(UnitOfWorkValueHolder.java:222)
        at org.eclipse.persistence.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:88)
        at oracle.communications.platform.entity.impl.ExtensionPointRuleSetDAO._persistence_get_ruleSetEntity(ExtensionPointRuleSetDAO.java)
        at oracle.communications.platform.entity.impl.ExtensionPointRuleSetDAO.getRuleSetEntity(ExtensionPointRuleSetDAO.java:272)
        at oracle.communications.inventory.extensibility.extension.util.ExtensionRuleMediator.findExtensionPointRule(ExtensionRuleMediator.java:267)
        at oracle.communications.inventory.extensibility.extension.util.ExtensionRuleMediator.initialize(ExtensionRuleMediator.java:134)
        at oracle.communications.inventory.extensibility.extension.SpecBasedArgumentExtension.configureMediator(SpecBasedArgumentExtension.aj:134)
    Thanks,
    Ravindra

    Hi,
    Found a note explaining the significance of these errors.
    It says:
    "NZE-28862: SSL connection failed
    Cause: This error occurred because the peer closed the connection.
    Action: Enable Oracle Net tracing on both sides and examine the trace output. Contact Oracle Customer support with the trace output."
    For further details you may refer the Note: 244527.1 - Explanation of "SSL call to NZ function nzos_Handshake failed" error codes
    Thanks & Regards,
    Sindhiya V.

  • Lazy Loading, Muse, and Scripts

    Hi, I'm trying to integrate Lazy loading with Muse in a Web Site.
    I would like know if anyone has a better workflow...
    So, first I uploaded to the server the "lazy loading content"
    http://dandalo.net/teste/lazy-patricia/lazy-pat.html
    Then, in Muse, I inserted the html from the page source that I had uploaded.
    http://dandalo.net/teste/export-muse/detalhes-old.html
    But it didn't work... : (
    So... 
    I have started looking at the html code that Muse created and fond this special phrase...    <!-- Other scripts -->
    Then, I tried this:
    Coping the scripts from the "lazy loading content" page and pasting it after this special line:
    http://dandalo.net/teste/export-muse/detalhes.html
    And it Worked !!!
    PS: The java scrips should be in root folder, not in the Scripts folder that Muse created
    Does anyone have any tip or workflow not to have to edit the html file to add these script lines?

    Hi
    Do you have the link to the "lazy loading content"?
    I can't find a proper way to do it.
    Thanks

  • JPA - lazy loading for LOB field

    Hi all,
    JPA 1.0 specification mandates that all JPA-compliant implementation support lazy loading for certain kind of entity field.
    For LOB fields lazy loading is OPTIONAL.
    I am experiencing odd runtime behaviors on my custom software which would point to this feature not being supported.
    Can anyone please tell me if SAP JPA 1.0 implementation on NW CE 711 implements this feature or not?
    Thanks in advance
    Regards
    Vincenzo

    Hi Vincenco,
    I am sure that this is the same as with single-valued relationships (@OneToOne, @ManyToOne): Lazy loading would require bytecode manipulation/generation, so SAP JPA does not support it in 7.20 (and of course not in 7.11)
    See tulsi jiddimani's elaborate answer here: Re: JPA: Documentation on LazyLoad.
    In 7.30 enhancements, you really can find lazy loading support for single-valued relationships with getReference.
    http://help.sap.com/saphelp_nw73/helpdata/en/68/f676ef36094f4381467a308a98fd2a/content.htm
    but @Lob and @Basic is not mentioned.
    If you need lazy loading in 7.11, you have two alternatives:
    1. Put the Lob fields into separate entities, work around the missing feature in SAP JPA with ugly @OneToMany - Relations
    2. Use another persistence provider like EclipseLink, read Sabine Heider's blogs about integrattion of EclipseLink in SAP NetWeaver and static bytecode weaving for lazy loading. /people/sabine.heider/blog
    Regards
    Rolf

Maybe you are looking for