Project

General

Profile

Feature #1580

upgrade Hibernate to latest level

Added by Eric Faulhaber over 11 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Start date:
10/23/2012
Due date:
05/03/2013
% Done:

100%

Estimated time:
575.00 h
billable:
No
vendor_id:
GCD

svl_test20130410a.zip (283 KB) Stanislav Lomany, 04/09/2013 05:27 PM

svl_test20130410c.zip (2.1 MB) Stanislav Lomany, 04/09/2013 05:29 PM

svl_test20130410d.zip (3.88 MB) Stanislav Lomany, 04/09/2013 05:31 PM

hibernate-orm-4.1.8.Final_patch_20130424a.zip (4.87 KB) Stanislav Lomany, 04/24/2013 10:42 AM

svl_upd20130501a.zip (2.41 MB) Stanislav Lomany, 05/01/2013 05:24 AM

svl_upd20130501b.zip (3.88 MB) Stanislav Lomany, 05/01/2013 05:25 AM

svl_upd20130502a.zip (2.41 MB) Stanislav Lomany, 05/02/2013 10:29 AM

svl_upd20130502b.zip (3.88 MB) Stanislav Lomany, 05/02/2013 10:31 AM

hibernate-orm-4.1.8.Final_patch.zip (4.92 KB) Stanislav Lomany, 09/20/2013 07:13 AM


Related issues

Related to Database - Feature #2156: datetime-tz and hibernate Closed
Related to Database - Feature #2140: use positional query substitution parameters in HQLPreprocessor and related classes Closed 09/02/2013 09/05/2013
Blocked by Core Development - Feature #1912: migrate P2J to Java 7 Closed 11/07/2012
Blocks Database - Feature #1588: add conversion and runtime support for embedded SQL Closed 02/14/2013 05/31/2013

History

#1 Updated by Eric Faulhaber over 11 years ago

P2J currently is at a woefully old level of Hibernate (3.0.5), which is holding back customer development. We need to upgrade to the latest level. However, there are known and possibly unknown problems in doing so.

For one, we have added a number of patches to fix issues we have found with the Hibernate HQL parser and SQL generator code. See the various hibernate_3.0.5_*_patch files in p2j/lib. These must be brought forward or modified as necessary. Also, the last time we attempted to upgrade to a later Hibernate (already some years ago), we encountered new parser problems. Apparently, the Hibernate developers had made the HQL parser more strict, such that some constructs we depend upon are no longer allowed. We have to investigate and find a workable solution, which may involve patching Hibernate again, or may require changes to the conversion/runtime code.

Furthermore, we rely on a Hibernate interface, org.hibernate.engine.Mapping, providing our own implementation in com.goldencode.p2j.persist.TempTableHelper. Although the interface is public, it seems to be there for internal Hibernate use. See the portability note in TempTableHelper.TableMapping.

I expect Hibernate has long since implemented Java generics in its public API, so we probably will need to change the many places we interface with Hibernate to do the same.

Then there are the unknown issues...we will need a full regression test to hopefully shake those out.

Note: we most likely will have to upgrade again within the next 18-24 months, but I expect the amount of change in the areas we care about between now and then will be less than what we are facing currently.

#2 Updated by Eric Faulhaber over 11 years ago

  • Start date changed from 10/15/2012 to 10/23/2012
  • Status changed from New to WIP

#3 Updated by Stanislav Lomany over 11 years ago

The following compilation problems have been found:
1. org.hibernate.Session.connection function doesn't exist any more, it can be replaced with Session.doWork
2. org.hibernate.SessionFactory.openSession(Interceptor) doesn't exist (Persistence.java)
3. org.hibernate.service.jdbc.connections.spi.ConnectionProvider has new methods to implement: unwrap and isUnwrappableAs (UnpooledConnectionProvider.java, TempTableConnectionProvider.java)
4. org.hibernate.engine.spi.Mapping has new method: getIdentifierGeneratorFactory (TableMapping.java), can be implemented as stub
5. Hibernate.custom should be replaced with TypeHelper.custom. TypeHelper can be obtained from a SessionFactory (database-specific), while Hibernate.custom is used in static initialization code. However something like

TYPES.put(integer.class   , new CustomType(new IntegerUserType()));

may also work.
6. Hibernate.entity should be replaced with TypeHelper.entity.
7. org.hibernate.property.Getter hes new methods: getForInsert and getMember (NopPropertyAccessor.java)
8. ConnectionProviderFactory class no longer exist (TempTableConnectionProvider.java)
9. org.hibernate.service.jdbc.connections.spi.ConnectionProvider.close method no longer exist (TempTableConnectionProvider.java)
10. org.hibernate.cfg.Configuration.buildSettings signature changed (ImportWorker.java)
11. org.hibernate.cfg.Settings.getDialect method doesn't exist (ImportWorker.java)
12. org.hibernate.service.jdbc.dialect.spi.DialectFactory.buildDialect signature changed (ImportWorker.java)
13. org.hibernate.usertype.UserType signature changed, can easily be adapted (AbstractWrapperUserType.java)
14. Some changes in Hibernate package structure.

#4 Updated by Greg Shah over 11 years ago

  • Target version set to Milestone 7

#5 Updated by Stanislav Lomany over 11 years ago

1. In many places Hibernate Session.connection() is used, usually in order to create and execute a statement, but this function was deprecated and it is recommended to use session.doWork instead:

Work work = new Work()
{
   public void execute(Connection connection) throws SQLException
   {
      Statement stmt = connection.createStatement();
      stmt.execute(sql);
   }
};
session.doWork(work);

But in some cases connection is stored for future use or it participates in some complicated logic, e.g. Persistence.checkOutConnection and SequenceIdenityManager. In this case we can use
((SessionImpl) session).connection() 

construction. Is this appropriate?
2. TempTableConnectionProvider and UnpooledConnectionProvider now implement Configurable, also they were updated to match new ConnectionProvider interface (2 new methods added):
   public boolean isUnwrappableAs(Class unwrapType)
   {
      return ConnectionProvider.class.equals( unwrapType ) ||
                UnpooledConnectionProvider.class.isAssignableFrom( unwrapType );
   }

   public <T> T unwrap(Class<T> unwrapType)
   {
      if (isUnwrappableAs(unwrapType)) {
            return (T) this;
        }
        else {
            throw new UnknownUnwrapTypeException( unwrapType );
        }
   }

3. into Persistence the following code:

Interceptor interceptor =
               changeBroker.getInterceptor(Persistence.this);
session = factory.openSession(interceptor);

was replaced with:
Interceptor interceptor =
               changeBroker.getInterceptor(Persistence.this);
session = factory.withOptions().interceptor(interceptor).openSession();

4. NopPropertyAccessor has been updated: new method added: getMember (returns null), getForInsert signature updated
5. TempTableHelper.TableMapping and an anonymous class in P2JH2Dialect now implement 2 new Mapping methods:
 public IdentifierGeneratorFactory getIdentifierGeneratorFactory()
 {
    return null;
 }
 public Type getReferencedPropertyType(String dmoCls, String propertyName) throws MappingException
 {
    return getPersistentClass(dmoCls).getProperty(propertyName).getType();
 }

6. DBUtils and ImportWorker has been updated (Hibernate.custom was removed):
  // Initialize the TYPES map.
   static
   {
      TYPES.put(integer.class   , new CustomType(new IntegerUserType()));
      TYPES.put(recid.class     , new CustomType(new IntegerUserType()));
      TYPES.put(decimal.class   , new CustomType(new DecimalUserType()));
      TYPES.put(character.class , new CustomType(new CharacterUserType()));
      TYPES.put(logical.class   , new CustomType(new LogicalUserType()));
      TYPES.put(date.class      , new CustomType(new DateUserType()));
      TYPES.put(raw.class       , new CustomType(new RawUserType()));
      TYPES.put(rowid.class     , new CustomType(new RowIDUserType()));
      TYPES.put(Integer.class   , StandardBasicTypes.INTEGER);
      TYPES.put(Long.class      , StandardBasicTypes.LONG);
      TYPES.put(IntegerField.class   ,
                new CustomType(new IntegerUserType()));
      TYPES.put(DecimalField.class   ,
                new CustomType(new DecimalUserType()));
      TYPES.put(CharacterField.class ,
                new CustomType(new CharacterUserType()));
      TYPES.put(LogicalField.class   ,
                new CustomType(new LogicalUserType()));
      TYPES.put(DateField.class      ,
                new CustomType(new DateUserType()));
      TYPES.put(RawField.class       ,
                new CustomType(new RawUserType()));
   }

7. *UserType classes now implement the following methods:
 protected Object getBaseValue(ResultSet rs, String column)
   throws SQLException
   {
      return rs.getBigDecimal(column);
   }

   protected final BaseDataType instantiateRegular(Object value)
   {
      return new decimal((BigDecimal) value);
   }

   protected final BaseDataType instantiateUnknown()
   {
      return new decimal();
   }


8. AbstractWrapperUserType.nullSafeGet and nullSafeSet signatures were update.

#6 Updated by Stanislav Lomany over 11 years ago

I found that HQL parser doesn't support WHERE TRUE or WHERE FALSE where clause. I've applied the old Hibernate patches, but met some weird gradle problems (gradle is the new Hibernate official build instrument), but I think I almost passed them.

#7 Updated by Stanislav Lomany over 11 years ago

I've applied old Hibernate patches, still cannot compile it, but .g files were converted so I used them: WHERE TRUE / WHERE FALSE statements are OK, but I found some other problems while walking thru Majic, I'll post them later.

#8 Updated by Stanislav Lomany over 11 years ago

I've build Hibernate. Although I haven't found any mentions about this, it turned out that Hibernate 4 requires Java 7 for compilation.

#9 Updated by Stanislav Lomany over 11 years ago

9. Changes into ImportWorker:
Into ImportWorker.Library.initialize:

Settings settings = config.buildSettings();

// Save off dialect for later use.
dialect = (P2JDialect) settings.getDialect();

was replaced with:
ServiceRegistry sr = new ServiceRegistryBuilder()
                     .applySettings(props)
                 .buildServiceRegistry();
Settings settings = config.buildSettings(sr);

// Save off dialect for later use.
dialect = (P2JDialect) Dialect.getDialect(props);

Into Into ImportWorker.Library.generateIndexDDL:

if (dialect == null)
            dialect = (P2JDialect) DialectFactory.buildDialect(dialectName);

was replaced with:
if (dialect == null)
{
   Properties props = new Properties();
   props.put(Environment.DIALECT, dialectName);
   dialect = (P2JDialect) Dialect.getDialect(props);
}

Now I'm working on the following exception:

Caused by: java.lang.ClassCastException: org.hibernate.hql.internal.ast.tree.ParameterNode cannot be cast to org.hibernate.hql.internal.ast.tree.SelectExpression
        at org.hibernate.hql.internal.ast.tree.CaseNode.getFirstThenNode(CaseNode.java:43)
        at org.hibernate.hql.internal.ast.tree.CaseNode.getDataType(CaseNode.java:39)
        at org.hibernate.hql.internal.ast.tree.BinaryLogicOperatorNode.extractDataType(BinaryLogicOperatorNode.java:231)
        at org.hibernate.hql.internal.ast.tree.BinaryLogicOperatorNode.initialize(BinaryLogicOperatorNode.java:60)
        at org.hibernate.hql.internal.ast.HqlSqlWalker.prepareLogicOperator(HqlSqlWalker.java:1224)
        at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:4498)
        at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1973)
        at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.logicalOp(HqlSqlBaseWalker.java:3913)
        at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1951)
        at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.whereClause(HqlSqlBaseWalker.java:794)
        at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:595)
        at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:299)
        at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:247)
        at org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:248)
        at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:183)
        at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)
        at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:105)
        at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
        at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:168)
        at org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:221)
        at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:199)
        at org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:1735)
        at com.goldencode.p2j.persist.Persistence$Context.getQuery(Persistence.java:3904)
        at com.goldencode.p2j.persist.Persistence.getQuery(Persistence.java:3780)
        at com.goldencode.p2j.persist.Persistence.load(Persistence.java:1611)
        at com.goldencode.p2j.persist.RandomAccessQuery.executeImpl(RandomAccessQuery.java:2870)
        at com.goldencode.p2j.persist.RandomAccessQuery.execute(RandomAccessQuery.java:2172)
        at com.goldencode.p2j.persist.RandomAccessQuery.first(RandomAccessQuery.java:856)
        at com.goldencode.p2j.persist.RandomAccessQuery.first(RandomAccessQuery.java:762)
        at aero.timco.majic.item.ItemProgram$1$2.body(ItemProgram.java:694)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8039)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7933)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1499)
        at aero.timco.majic.item.ItemProgram$1.body(ItemProgram.java:619)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6890)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:194)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:180)
        at aero.timco.majic.item.ItemProgram.execute(ItemProgram.java:159)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:229)
        at aero.timco.majic.menu.Call$1$2.body(Call.java:173)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8039)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7848)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:683)
        at aero.timco.majic.menu.Call$1.body(Call.java:103)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6890)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:194)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:180)
        at aero.timco.majic.menu.Call.execute(Call.java:34)
        at aero.timco.majic.menu.Call$1$2.body(Call.java:256)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8039)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7848)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:683)
        at aero.timco.majic.menu.Call$1.body(Call.java:103)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6890)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:194)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:180)
        at aero.timco.majic.menu.Call.execute(Call.java:34)
        at aero.timco.majic.menu.Majic$1$1.body(Majic.java:175)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8039)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7933)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1579)
        at aero.timco.majic.menu.Majic$1.body(Majic.java:68)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6890)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:194)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:180)
        at aero.timco.majic.menu.Majic.execute(Majic.java:32)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.Utils.invoke(Utils.java:1153)
        at com.goldencode.p2j.main.StandardServer$MainInvoker.execute(StandardServer.java:1513)
        at com.goldencode.p2j.main.StandardServer.invoke(StandardServer.java:1019)
        at com.goldencode.p2j.main.StandardServer.standardEntry(StandardServer.java:320)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.MethodInvoker.invoke(MethodInvoker.java:76)
        at com.goldencode.p2j.net.Dispatcher.processInbound(Dispatcher.java:675)
        at com.goldencode.p2j.net.Conversation.block(Conversation.java:316)
        at com.goldencode.p2j.net.Conversation.run(Conversation.java:158)
        at java.lang.Thread.run(Thread.java:662)

#10 Updated by Stanislav Lomany over 11 years ago

Class cast exception bug exists in Hibernate bug tracker: https://hibernate.onjira.com/browse/HHH-4700 , not fixed yet. There is the posted proposed solution, but it doesn't work.

Failing case is: "case SOMETHING then ? else SOMETHING", Hibernate fails to get substitution parameter (?) data type. The deeper problem is that a substitution parameter doesn't have an expected data type assigned.

However "case SOMETHING then ? else ?" for temporary tables doesn't fails because of this P2J function:

/**
    * Replaces "then ? else ?" substatement of the given ternary with "then
    * cast(? as &lt;datatype&gt;) else cast(? as &lt;datatype&gt;)". E.g. 
    * given substatement will be replaced with "then cast(? as big_decimal)
    * else cast(? as big_decimal)" is we have a decimal variable.<p>
    * Originally designed as a workaround of the H2 bug.
    *
    * @param ternary
    *        Node which represents the ternary (i.e. "case when ... then ...
    *        else ... end") in which replacement should be done.
    */
   private void tryExplicitCastInTernary(HQLAst ternary)

So we can extend this workaround for permanent databases and "case SOMETHING then ? else SOMETHING" or we can dig into Hibernate.
ERIC, what do you think?

#11 Updated by Eric Faulhaber over 11 years ago

If we didn't already have this workaround for a similar case, I would say let's fix it in Hibernate, but since we are already part of the way there, let's extend the workaround to cover this permutation.

#12 Updated by Eric Faulhaber over 11 years ago

Stanislav Lomany wrote:

I found that HQL parser doesn't support WHERE TRUE or WHERE FALSE where clause. I've applied the old Hibernate patches, but met some weird gradle problems (gradle is the new Hibernate official build instrument), but I think I almost passed them.

Under what circumstances do we need to support WHERE TRUE and WHERE FALSE? Is this something we should optimize during conversion? It seems like WHERE TRUE could be dropped altogether, and a query with WHERE FALSE should not be processed at all (perhaps we should just release the record from the buffer instead).

#13 Updated by Stanislav Lomany over 11 years ago

Under what circumstances do we need to support WHERE TRUE and WHERE FALSE? Is this something we should optimize during conversion? It seems like WHERE TRUE could be dropped altogether, and a query with WHERE FALSE should not be processed at all (perhaps we should just release the record from the buffer instead).

WHERE TRUE or WHERE FALSE are results of P2J runtime query optimization. I agree that we should drop WHERE clause if it is WHERE TRUE and do not run query if it is WHERE FALSE.

#14 Updated by Eric Faulhaber over 11 years ago

Stanislav Lomany wrote:

WHERE TRUE or WHERE FALSE are results of P2J runtime query optimization. I agree that we should drop WHERE clause if it is WHERE TRUE and do not run query if it is WHERE FALSE.

I will add a code improvement task for this, but it will be low priority, since you already have this bit working in Hibernate.

#15 Updated by Stanislav Lomany over 11 years ago

In order to enable EhCache, the following entry should be added to the directory:

<node class="container" name="cache">
   ...
   <node class="container" name="region">
      <node class="string" name="factory_class">
         <node-attribute name="value" value="org.hibernate.cache.ehcache.EhCacheRegionFactory"/>
      </node>
   </node>
</node>

The following jars should be added to classpath: hibernate-ehcache-*.jar, ehcache-core-*.jar, slf4j-api-*.jar, slf4j-jdk14-*.jar

#16 Updated by Stanislav Lomany over 11 years ago

In order to get rid of the "(org.hibernate.internal.util.xml.DTDEntityResolver:WARN) HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead." warnings in hibernate_templates.tpl this:

<ast id="0" type="SYSTEM_ID" text="http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" />

was changed to
<ast id="0" type="SYSTEM_ID" text="http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd" />

#17 Updated by Stanislav Lomany over 11 years ago

Log file is full of this kind of warnings:

[DEPRECATION] Encountered positional parameter near line *, column *.  Positional parameter are considered deprecated; use named parameters or JPA-style positional parameters instead.

I'm looking into it while regression testing is running.

#18 Updated by Eric Faulhaber over 11 years ago

It seems like using JPA-style positional parameters (?1, ?2, ?3, ...) would be much easier than changing conversion or the HQLPreprocessor to use named parameters. The question is: is it better to deal with this during conversion (and have it emitted in business logic this way), or during where clause preprocessing at runtime. For the latter, we have to take into consideration the restructuring we do during HQL preprocessing with respect to extent field references (see HQLPreprocessor.restructure).

#19 Updated by Stanislav Lomany over 11 years ago

As far as I've analyzed the regression testing log (it is 500M), there are three types of errors:
1. Boolean literals cannot be used:

Caused by: java.lang.ClassCastException: com.goldencode.p2j.persist.type.LogicalUserType cannot be cast to org.hibernate.usertype.EnhancedUserType
        at org.hibernate.type.CustomType.objectToSQLString(CustomType.java:200)
        at org.hibernate.hql.internal.ast.tree.BooleanLiteralNode.getRenderText(BooleanLiteralNode.java:62)
        at org.hibernate.hql.internal.ast.SqlGenerator.out(SqlGenerator.java:121)
        at org.hibernate.hql.internal.antlr.SqlGeneratorBase.simpleExpr(SqlGeneratorBase.java:2757)
        at org.hibernate.hql.internal.antlr.SqlGeneratorBase.expr(SqlGeneratorBase.java:1605)
        at org.hibernate.hql.internal.antlr.SqlGeneratorBase.binaryComparisonExpression(SqlGeneratorBase.java:3366)
        at org.hibernate.hql.internal.antlr.SqlGeneratorBase.comparisonExpr(SqlGeneratorBase.java:1415)
        at org.hibernate.hql.internal.antlr.SqlGeneratorBase.booleanExpr(SqlGeneratorBase.java:975)
        at org.hibernate.hql.internal.antlr.SqlGeneratorBase.booleanOp(SqlGeneratorBase.java:2974)
        at org.hibernate.hql.internal.antlr.SqlGeneratorBase.booleanExpr(SqlGeneratorBase.java:955)
        at org.hibernate.hql.internal.antlr.SqlGeneratorBase.booleanOp(SqlGeneratorBase.java:2969)
        at org.hibernate.hql.internal.antlr.SqlGeneratorBase.booleanExpr(SqlGeneratorBase.java:955)
        at org.hibernate.hql.internal.antlr.SqlGeneratorBase.whereExpr(SqlGeneratorBase.java:821)
        at org.hibernate.hql.internal.antlr.SqlGeneratorBase.selectStatement(SqlGeneratorBase.java:178)
        at org.hibernate.hql.internal.antlr.SqlGeneratorBase.statement(SqlGeneratorBase.java:111)
        at org.hibernate.hql.internal.ast.QueryTranslatorImpl.generate(QueryTranslatorImpl.java:232)
        at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:203)
        at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)
        at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:105)
        at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
        at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:168)
        at org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:221)
        at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:199)
        at org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:1735)
        at com.goldencode.p2j.persist.Persistence$Context.getQuery(Persistence.java:3904)
        at com.goldencode.p2j.persist.Persistence.getQuery(Persistence.java:3780)
        at com.goldencode.p2j.persist.Persistence.scroll(Persistence.java:1327)
        at com.goldencode.p2j.persist.PresortQuery.executeScroll(PresortQuery.java:771)
        at com.goldencode.p2j.persist.PreselectQuery.executeQuery(PreselectQuery.java:3761)
        at com.goldencode.p2j.persist.PreselectQuery.execute(PreselectQuery.java:3481)
        at com.goldencode.p2j.persist.PreselectQuery.next(PreselectQuery.java:1575)
        at com.goldencode.p2j.persist.PreselectQuery.next(PreselectQuery.java:1549)
        at aero.timco.majic.util.AccrR$1$1$4.body(AccrR.java:699)
        at com.goldencode.p2j.util.BlockManager.processForBody(BlockManager.java:7056)
        at com.goldencode.p2j.util.BlockManager.forEachWorker(BlockManager.java:8469)
        at com.goldencode.p2j.util.BlockManager.forEach(BlockManager.java:3761)
        at aero.timco.majic.util.AccrR$1$1.body(AccrR.java:617)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8039)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7933)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1579)
        at aero.timco.majic.util.AccrR$1.body(AccrR.java:320)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6890)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:194)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:180)
        at aero.timco.majic.util.AccrR.execute(AccrR.java:116)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:229)
        at aero.timco.majic.menu.Call$1$2.body(Call.java:173)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8039)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7848)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:683)
        at aero.timco.majic.menu.Call$1.body(Call.java:103)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6890)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:194)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:180)
        at aero.timco.majic.menu.Call.execute(Call.java:34)
        at aero.timco.majic.menu.Call$1$2.body(Call.java:256)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8039)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7848)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:683)
        at aero.timco.majic.menu.Call$1.body(Call.java:103)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6890)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:194)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:180)
        at aero.timco.majic.menu.Call.execute(Call.java:34)
        at aero.timco.majic.menu.Majic$1$1.body(Majic.java:170)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8039)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7933)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1579)
        at aero.timco.majic.menu.Majic$1.body(Majic.java:63)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6890)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:194)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:180)
        at aero.timco.majic.menu.Majic.execute(Majic.java:31)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.Utils.invoke(Utils.java:1153)
        at com.goldencode.p2j.main.StandardServer$MainInvoker.execute(StandardServer.java:1513)
        at com.goldencode.p2j.main.StandardServer.invoke(StandardServer.java:1019)
        at com.goldencode.p2j.main.StandardServer.standardEntry(StandardServer.java:320)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.MethodInvoker.invoke(MethodInvoker.java:76)
        at com.goldencode.p2j.net.Dispatcher.processInbound(Dispatcher.java:675)
        at com.goldencode.p2j.net.Conversation.block(Conversation.java:316)
        at com.goldencode.p2j.net.Conversation.run(Conversation.java:158)
        at java.lang.Thread.run(Thread.java:619)

2.

[11/13/2012 15:08:58 EST] (com.goldencode.p2j.persist.Persistence$Context:SEVERE) Error closing Hibernate session during context cleanup
com.goldencode.p2j.persist.PersistenceException: [00000001:0000001F:syman-->lightning.timco.aero/10.114.1.99:3433/majic/primary] error closing Hibernate session
        at com.goldencode.p2j.persist.Persistence$Context.closeSessionImpl(Persistence.java:4701)
        at com.goldencode.p2j.persist.Persistence$Context.closeSession(Persistence.java:4562)
        at com.goldencode.p2j.persist.Persistence$Context.cleanup(Persistence.java:4803)
        at com.goldencode.p2j.persist.Persistence$1.cleanup(Persistence.java:590)
        at com.goldencode.p2j.persist.Persistence$1.cleanup(Persistence.java:588)
        at com.goldencode.p2j.security.ContextLocal$Wrapper.cleanup(ContextLocal.java:367)
        at com.goldencode.p2j.security.SecurityContext.cleanup(SecurityContext.java:437)
        at com.goldencode.p2j.security.SecurityManager.endContext(SecurityManager.java:6710)
        at com.goldencode.p2j.security.SecurityManager.popContextWorker(SecurityManager.java:6648)
        at com.goldencode.p2j.security.SecurityManager.popAndRestoreSecurityContext(SecurityManager.java:3885)
        at com.goldencode.p2j.net.RouterSessionManager.restoreContext(RouterSessionManager.java:1041)
        at com.goldencode.p2j.net.Queue.stop(Queue.java:414)
        at com.goldencode.p2j.net.Protocol$Reader.run(Protocol.java:416)
        at java.lang.Thread.run(Thread.java:619)
Caused by: org.hibernate.service.UnknownServiceException: Unknown service requested [org.hibernate.stat.spi.StatisticsImplementor]
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:126)
        at org.hibernate.internal.SessionFactoryImpl.getStatisticsImplementor(SessionFactoryImpl.java:1468)
        at org.hibernate.internal.SessionFactoryImpl.getStatistics(SessionFactoryImpl.java:1464)
        at org.hibernate.internal.SessionImpl.close(SessionImpl.java:346)
        at com.goldencode.p2j.persist.Persistence$Context.closeSessionImpl(Persistence.java:4682)
        at com.goldencode.p2j.persist.Persistence$Context.closeSession(Persistence.java:4562)
        at com.goldencode.p2j.persist.Persistence$Context.cleanup(Persistence.java:4803)
        at com.goldencode.p2j.persist.Persistence$1.cleanup(Persistence.java:590)
        at com.goldencode.p2j.persist.Persistence$1.cleanup(Persistence.java:588)
        at com.goldencode.p2j.security.ContextLocal$Wrapper.cleanup(ContextLocal.java:367)
        at com.goldencode.p2j.security.SecurityContext.cleanup(SecurityContext.java:437)
        at com.goldencode.p2j.security.SecurityManager.endContext(SecurityManager.java:6710)
        at com.goldencode.p2j.security.SecurityManager.popContextWorker(SecurityManager.java:6648)
        at com.goldencode.p2j.security.SecurityManager.popAndRestoreSecurityContext(SecurityManager.java:3885)
        at com.goldencode.p2j.net.RouterSessionManager.restoreContext(RouterSessionManager.java:1041)
        at com.goldencode.p2j.net.Queue.stop(Queue.java:414)
        at com.goldencode.p2j.net.Protocol$Reader.run(Protocol.java:416)
        at java.lang.Thread.run(Thread.java:619)

3.

Caused by: org.hibernate.HibernateException: Found two representations of same collection: aero.timco.majic.dmo.majic.impl.CrossReferenceItemImpl.composite4
        at org.hibernate.engine.internal.Collections.processReachableCollection(Collections.java:167)
        at org.hibernate.event.internal.FlushVisitor.processCollection(FlushVisitor.java:59)
        at org.hibernate.event.internal.AbstractVisitor.processValue(AbstractVisitor.java:121)
        at org.hibernate.event.internal.AbstractVisitor.processValue(AbstractVisitor.java:82)
        at org.hibernate.event.internal.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:76)
        at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:174)
        at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:225)
        at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:99)
        at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
        at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1213)
        at com.goldencode.p2j.persist.Persistence$Context.maybeFlushSession(Persistence.java:4628)
        at com.goldencode.p2j.persist.Persistence$Context.rollback(Persistence.java:4047)
        at com.goldencode.p2j.persist.Persistence$Context.closeSession(Persistence.java:4542)
        at com.goldencode.p2j.persist.Persistence.flush(Persistence.java:3653)
        at com.goldencode.p2j.persist.Persistence.flush(Persistence.java:3610)
        at com.goldencode.p2j.persist.Persistence.flush(Persistence.java:3041)
        at com.goldencode.p2j.persist.RecordBuffer.rollback(RecordBuffer.java:3145)
        at com.goldencode.p2j.util.TransactionManager.processRollback(TransactionManager.java:4341)
        at com.goldencode.p2j.util.TransactionManager.rollbackWorker(TransactionManager.java:1634)
        at com.goldencode.p2j.util.TransactionManager.rollback(TransactionManager.java:1521)
        at com.goldencode.p2j.util.BlockManager.processCondition(BlockManager.java:8720)
        at com.goldencode.p2j.util.BlockManager.doBlockWorker(BlockManager.java:7707)
        at com.goldencode.p2j.util.BlockManager.doBlock(BlockManager.java:628)
        at aero.timco.majic.item.XrefU$1.body(XrefU.java:132)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6890)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:194)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:180)
        at aero.timco.majic.item.XrefU.execute(XrefU.java:60)
        at aero.timco.majic.item.Xrefinq$1$2$2.body(Xrefinq.java:1432)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8039)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7933)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1499)
        at aero.timco.majic.item.Xrefinq$1$2.body(Xrefinq.java:245)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8039)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7933)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1499)
        at aero.timco.majic.item.Xrefinq$1.body(Xrefinq.java:166)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6890)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:194)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:180)
        at aero.timco.majic.item.Xrefinq.execute(Xrefinq.java:64)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:229)
        at aero.timco.majic.menu.Call$1$2.body(Call.java:173)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8039)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7848)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:683)
        at aero.timco.majic.menu.Call$1.body(Call.java:103)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6890)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:194)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:180)
        at aero.timco.majic.menu.Call.execute(Call.java:34)
        at aero.timco.majic.menu.Call$1$2.body(Call.java:256)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8039)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7848)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:683)
        at aero.timco.majic.menu.Call$1.body(Call.java:103)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6890)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:194)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:180)
        at aero.timco.majic.menu.Call.execute(Call.java:34)
        at aero.timco.majic.menu.Call$1$2.body(Call.java:256)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8039)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7848)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:683)
        at aero.timco.majic.menu.Call$1.body(Call.java:103)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6890)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:194)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:180)
        at aero.timco.majic.menu.Call.execute(Call.java:34)
        at aero.timco.majic.menu.Majic$1$1.body(Majic.java:170)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8039)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7933)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1579)
        at aero.timco.majic.menu.Majic$1.body(Majic.java:63)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6890)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:194)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:180)
        at aero.timco.majic.menu.Majic.execute(Majic.java:31)
        at sun.reflect.GeneratedMethodAccessor4386.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.Utils.invoke(Utils.java:1153)
        at com.goldencode.p2j.main.StandardServer$MainInvoker.execute(StandardServer.java:1513)
        at com.goldencode.p2j.main.StandardServer.invoke(StandardServer.java:1019)
        at com.goldencode.p2j.main.StandardServer.standardEntry(StandardServer.java:320)
        at sun.reflect.GeneratedMethodAccessor807.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.MethodInvoker.invoke(MethodInvoker.java:76)
        at com.goldencode.p2j.net.Dispatcher.processInbound(Dispatcher.java:675)
        at com.goldencode.p2j.net.Conversation.block(Conversation.java:316)
        at com.goldencode.p2j.net.Conversation.run(Conversation.java:158)
        at java.lang.Thread.run(Thread.java:619)

#20 Updated by Stanislav Lomany over 11 years ago

Interesting thing about boolean literals issue is that it presents in the latest Hibernate release (at first I thought it was brought by our patches) and I found no corresponding bug in their bug tracker.

#21 Updated by Eric Faulhaber over 11 years ago

So, what are your thoughts about how we address these 3 errors?

Also, thoughts on the deprecated, positional parameters?

#22 Updated by Stanislav Lomany over 11 years ago

Boolean literals can be fixed by the following changes in org.hibernate.hql.internal.ast.tree.BooleanLiteralNode:

public String getRenderText(SessionFactoryImplementor sessionFactory) {
   try {
      return typeAsLiteralType().objectToSQLString( getValue(), sessionFactory.getDialect() );
   }    
   catch( Throwable t ) {
      throw new QueryException( "Unable to render boolean literal value", t );
   }
}

was changed to:
public String getRenderText(SessionFactoryImplementor sessionFactory) {
   try {
      if (getDataType() instanceof LiteralNode)
         return typeAsLiteralType().objectToSQLString( getValue(), sessionFactory.getDialect() );
      else
         return getText();
    }
    catch( Throwable t ) {
       throw new QueryException( "Unable to render boolean literal value", t );
    }
}

I'm not ready to propose solutions for other issues.

#23 Updated by Eric Faulhaber over 11 years ago

Stanislav Lomany wrote:

Interesting thing about boolean literals issue is that it presents in the latest Hibernate release (at first I thought it was brought by our patches) and I found no corresponding bug in their bug tracker.

But is it caused by unsupported HQL generated by P2J? I think the Hibernate HQL parser has become less lenient since v3.0.5. Is the HQL causing this error a case of something they supported in the older version that possibly was eliminated as invalid HQL in later releases?

Can you find any similar errors reported in the Hibernate forum? When we last tried to upgrade to a newer Hibernate (already some years ago), we hit some HQL parsing error that other people had reported, and the response from a Hibernate developer was that the HQL in question in that case was always wrong, but the old parser incorrectly had allowed it to pass, whereas the newer parser was (correctly) more strict. Is this possibly a similar case? I ask because we will find it hard to get our fix accepted into the main code base if it circumvents an intentional tightening of the parser.

#24 Updated by Stanislav Lomany over 11 years ago

I have some troubles with Hibernate. I have the small project to deal with different versions of Hibernate and while I was investigating the boolean literals issue I found that it unpredictably appears or doesn't appear on different Hibernate version. More over, I could get different output for the same program and the set of jars. After some time of frustration I found that the output depends on the order of jars (p2j jar, Hibernate core jar, required Hibernate libraries) specified in the -classpath parameter.
I can provide a sample output (unfortunately it is not related to the boolean literals issue).
Any recommendations?

#25 Updated by Eric Faulhaber over 11 years ago

Have you removed all the old versions of the Hibernate jar and its dependencies from the project and from the p2j.mf (and p2jrt.mf) file? What does the output of System.getProperty("java.class.path") show for the configuration that works best?

#26 Updated by Stanislav Lomany over 11 years ago

About boolean literals:
1. The bug/feature is related only to the fields of the P2J LogicalUserType (and any other custom types comparable with booleans), fields of "boolean" hibernate type are handled without errors.
2. It appeared in Hibernate 3.2 cr3 when BooleanLiteralNode was introduced. This node has an "expected" boolean type which it gets from the opposite operand. This was made because booleans can be of different types, i.e. true/false, yes/no, 'true'/'false' etc.
3. Change log of this version

Chages in version 3.2 cr3 (2006.07.06)
-------------------------------------------

** Bug
    * [HHH-1452] - Native SQL query is missing join if entity includes many-to-one on secondary table
    * [HHH-1507] - one-to-one can have formula or meta but not both of them.
    * [HHH-1552] - Error when using ?1 and parameterList
    * [HHH-1586] - ClassCastException in CollectionType.toLoggableString if using CustomCollectionType
    * [HHH-1732] - EhCache.toMap still assumes Serializable objects
    * [HHH-1734] - Connection leak when using hilo strategy in SE environment
    * [HHH-1741] - Bug in reference documentation
    * [HHH-1746] - NullPointerException at IdentNode.resolveAsNakedComponentPropertyRefLHS(IdentNode.java:195
    * [HHH-1748] - Setting a comment that contains a single quote on a query results in an unintuitive exception
    * [HHH-1763] - Bug in InputStream org.hibernate.util.ConfigHelper.getResourceAsStream(String resource)
    * [HHH-1791] - property update="false" ignored since 3.2.0.cr2
    * [HHH-1816] - serializing session from a named session factory to a different vm broken
    * [HHH-1822] - flushing entity linked to transient instance (non cascaded) should always fail
    * [HHH-1828] - registering a transaction marked for Rollback is illegal
    * [HHH-1833] - Not Generating HibernateException
    * [HHH-1838] - Wrong SQL generated for hql query on "any" relation
    * [HHH-1855] - booleans not properly handled in assignment clause of UPDATE statements
    * [HHH-1858] - wrong sql generated against many-to-any association table
    * [HHH-1871] - query type autodiscovery assume wrong column when mixing entities and scalars

** Deprecation
    * [HHH-1792] - Callable update/insert/delete statements should not force rowcount out parameter

** Improvement
    * [HHH-1617] - Check the second-level cache before adding a PK to a batch fetch
    * [HHH-1773] - Typo in ImprovedNamingStrategy
    * [HHH-1779] - Allow Session.remove() on transient object
    * [HHH-1789] - improve efficiency of collection initialization from L2 cache hits
    * [HHH-1795] - default cache provider to NoCacheProvider
    * [HHH-1796] - TreeCache based providers and Fqn
    * [HHH-1800] - session.get() / load() should raise exception when the id is of the wrong type
    * [HHH-1818] - remove() should force subsequent contains() calls to return false
    * [HHH-1831] - Batch loading the same EntityKey (one side of manytoone ) more than once
    * [HHH-1861] - More complete component handling in HQL
    * [HHH-1881] - introduce LoggableUserType interface

** New Feature
    * [HHH-1709] - Be able to raise ENFE rather than LIE in proxies
    * [HHH-1727] - Add a SQLFunctionRegistry
    * [HHH-1817] - Introduce setting for JPA-QL strict compliance
    * [HHH-1826] - Built-in type for char[] -> VARCHAR Byte[] and Character[]

** Patch
    * [HHH-1558] - Dialect for new database engine H2
    * [HHH-1847] - QBE 'like' clause with backslashes don't work with MySQL

** Task
    * [HHH-1839] - rename FlushMode.NEVER -> FlushMode.MANUAL

Doesn't look that this was introduced intentionally.
4. Possible work around: use quotes for boolean literals: 'true' and 'false'
5. I don't know why so obvious solution didn't come to my mind earlier: just make com.goldencode.p2j.persist.type.LogicalUserType implement org.hibernate.usertype.EnhancedUserType, specifically this:
  public String objectToSQLString(Object value)
   {
      return value.toString();
   }

#27 Updated by Eric Faulhaber over 11 years ago

Stanislav Lomany wrote:

4. Possible work around: use quotes for boolean literals: 'true' and 'false'
5. I don't know why so obvious solution didn't come to my mind earlier: just make com.goldencode.p2j.persist.type.LogicalUserType implement org.hibernate.usertype.EnhancedUserType, specifically this:
[...]

Sounds reasonable. Will we still need the workaround in bullet 4? I'm not crazy about that one, but if that's how one does HQL with this version, I guess we have to follow suit.

#28 Updated by Stanislav Lomany over 11 years ago

Modification of LogicalUserType completely solves the problem (unless regression testing will show a surprise). Other bullets just reflect the work process.

#29 Updated by Eric Faulhaber over 11 years ago

How common was the

org.hibernate.HibernateException: Found two representations of same collection: ...

error in the regression server log? This looks a lot like a defect I've been seeing in production for years, but I've never gotten a reliable recreate for it. This may well be a defect in P2J that's been there all along...

#30 Updated by Stanislav Lomany over 11 years ago

Eric Faulhaber wrote:

How common was the

[...]

error in the regression server log? This looks a lot like a defect I've been seeing in production for years, but I've never gotten a reliable recreate for it. This may well be a defect in P2J that's been there all along...

Appeared once.

#31 Updated by Eric Faulhaber over 11 years ago

Regarding the error...

Unknown service requested [org.hibernate.stat.spi.StatisticsImplementor]

From what I've been reading, I think this is caused by closing the Hibernate Session on a different thread than the one on which it was opened. Sessions are opened on the conversation thread, but in this case, it appears the client was disconnected and we're receiving the cleanup call on the reader thread.

This probably has been a bad practice on our part all along (to open and close a Session on different threads), but this error probably is a side effect of a change across Hibernate versions in the internal implementation of its statistics collection, which would explain why we're just seeing it now.

My intention in implementing Session closing during context cleanup was to make sure we cleaned up after ourselves. This error appears to me to be a problem in the net package (i.e., IMHO context cleanup should be always be called on the conversation thread as a matter of thread safety, before the conversation thread is allowed to end). I don't know how we fix it from the Persistence class.

Open to ideas... Greg?

#32 Updated by Greg Shah over 11 years ago

I don't think it is as simple as you suggest. By its nature, all contexts are accessed from multiple threads. At a minimum, reader/writer threads for the protocol and the conversation thread.

We cannot cleanup the context until all threads are no longer accessing the context. For this reason, we execute the cleanup on the last thread to exit. That is not guaranteed to be the conversation thread.

There is no guarantee that the conversation thread is actually the thread that added some particular data to the context.

The whole point of the context being shared across threads is that it is NOT thread-local data. Hibernate is the only thing that is wanting to match up things by thread. None of the rest of the runtime does this.

We can try to hold up the conversation thread and make it BOTH exit last and be the thread on which the cleanup occurs. But this would be an arbitrary decision. It certainly isn't clear that it should work the way you suggest.

Constantin: what do you think?

#33 Updated by Eric Faulhaber over 11 years ago

The Hibernate Session objects are created on the conversation thread (for that matter, all persistence runtime code outside of some specialized housekeeping runs on the conversation thread). Although I haven't looked at the latest Hibernate source, I suspect Hibernate is using a thread local variable internally and that is what is triggering the problem when we try to close the Session on another thread.

Stanislav: can you check this in the Hibernate source for this new version and produce a small test case to confirm (if necessary)?

All: perhaps we can overload the ContextLocal constructor, adding a new one with an option indicating the object's cleanup method should be called on the same thread on which the object was instantiated? This would leave the many other instances of ContextLocal throughout the project working as usual, but would allow us to address this case (assuming the net and/or security package changes to support this option are feasible).

#34 Updated by Constantin Asofiei over 11 years ago

Thoughts about context cleanup:
  1. If the we decide to clean the Hibernate session on the Conversion thread, then we need to make sure there is no possibility for the session to be created on a different thread. Keep in mind that a context can be set to 4 different types: Reader, Writer, Conversion and Dispatcher (at least for cases when CTRL-C is processed).
  2. What about server-to-server connections ? In these cases, there are only Reader and Writer threads, as Conversation thread is not needed (all work is done by Dispatchers). And if lets say a hibernate session is created by Dispatcher1 (and the ContextLocal object responsible for cleaning it knows on which thread it was created), then when Reader/Writer needs to close, it will need to wait for Dispatcher1 (or whatever other thread) to terminate any running work before placing the "clean this ContextLocal resource" task.
  3. Context cleanup is tightly integrated with the queue and session (both security and net) termination. At this time, whatever thread starts the context cleanup, it will clean all the Cleanable data. The point of this note is that I don't think we can leave only the full context cleanup for i.e. the Conversation thread; we will to let it process the entire work which ends up in context cleanup. And letting the thread which created the ContextLocal resource clean it poses the previous problem.

#35 Updated by Eric Faulhaber over 11 years ago

Regarding points 1 & 2 in the previous post: currently, there is no creation of Hibernate Session objects on anything but the conversation thread, even in server-to-server connections. When a server connects to another server for remote database access, it just gets the connection info from the remote server, but then the requesting server makes direct connections to the remote database (using Session objects created on the conversation thread). It communicates with the remote server also about record locking and dirty share info, but that doesn't involve creating Sessions on the remote side.

Regarding point 3: is this only a statement of how it works now, or are you saying a future implementation which allows a single ContextLocal.cleanup call to be made on the thread which created that ContextLocal instance is not feasible?

Before we go too far down this investigation, though, we need to know for sure that my assumption for the cause of this error is really a thread-related issue inside Hibernate. For that, we first need the results of Stanislav's analysis on this point.

#36 Updated by Constantin Asofiei over 11 years ago

Eric, at 3 I'm not saying that is not feasible; as only Conversation threads can create hibernate Sessions, at a first glance I would be inclined to say we can go ahead and move all context cleanup stuff to Conversation thread. But, what if at some point in time we will have a Cleanable implementation which needs to be cleaned on its creation thread, which is not Conversation ? So, with this, your choice of letting each Cleanable clean on its creation thread would seem reasanoble. But, are we sure that the creation thread will still be running, when the cleanup is needed ?

I realise this is a little bit of overthinking, but my thoughts are about what we could end up with in the future. For a first implementation, we could go ahead and assume all Cleanables must be cleaned on the Conversation thread (and I think this would be the simplest approach), but for a generic implementation, more analysis is needed.

#37 Updated by Greg Shah over 11 years ago

I don't like putting a Hibernate-specific hack into our more generic implementation.

Let's back up a bit. In what specific cases does a Hibernate session have to be cleaned up by the net/security package session-level context local cleanup? I thought that was just a "failsafe" approach that was to catch some unexpected failure on our part?

And in all the processing of the regression tests, it only happened once. Are we creating a mess in our implementation to handle something that should have be handled another way?

#38 Updated by Eric Faulhaber over 11 years ago

Eric Faulhaber wrote:

... Although I haven't looked at the latest Hibernate source, I suspect Hibernate is using a thread local variable internally and that is what is triggering the problem when we try to close the Session on another thread.

Stanislav: can you check this in the Hibernate source for this new version and produce a small test case to confirm (if necessary)?

Stas: do you have any feedback on this?

I will soon need an early candidate of your update for this issue (probably Vadim and Ovidiu will, too), even if it does not yet pass regression testing.

#39 Updated by Stanislav Lomany over 11 years ago

A session CAN be closed in another thread:

final SessionFactory factory = new Configuration().configure("hibernate.pg.cfg.xml").buildSessionFactory();
final Session session = factory.openSession();

Runnable r = new Runnable()
{
   @Override
   public void run()
   {
      Query q = session.createQuery("SELECT person FROM Person2Impl person WHERE person.logval = FALSE");
      ScrollableResults res = q.scroll();

      while (res.next())
      {
         for (Object o : res.get())
         {
            System.out.println(o);
         }
         System.out.println("...");
      }

      session.close();
   }
};

Thread thread = new Thread(r);
thread.start();
thread.join();

May be we fail to synchronize session object in P2J?

#40 Updated by Constantin Asofiei over 11 years ago

Stanislav,
From the org.hibernate.Session javadoc (http://docs.jboss.org/hibernate/orm/4.1/javadocs/org/hibernate/Session.html):

It is not intended that implementors be threadsafe. Instead each thread/transaction should obtain its own instance from a SessionFactory.

What I mean is that your test does not test real concurrency... and from my experience trying to duplicate a concurrency error is a headache, especially when the code is not even yours. Plus, for most cases the only way to find a concurrency issue was to place breakpoints at various code points and execute the code (in multiple threads) by hand, line-by-line, in the debugger.
IMO, if Hibernate says that Session is not thread safe, we should take it from granted, as, even if lets say the current Session implementation does not show obvious concurrency issues (as for the Hibernate used by P2J at this time), in the future this might change (as you find out with the Hibernate you've been testing).

#41 Updated by Eric Faulhaber over 11 years ago

Stas, my conclusion about this being a threading issue was based on some cursory Internet research. Please dig into the Hibernate source around

...
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:126)
at org.hibernate.internal.SessionFactoryImpl.getStatisticsImplementor(SessionFactoryImpl.java:1468)
at org.hibernate.internal.SessionFactoryImpl.getStatistics(SessionFactoryImpl.java:1464)
at org.hibernate.internal.SessionImpl.close(SessionImpl.java:346)
...

and determine what the true cause of that error message is.

#42 Updated by Stanislav Lomany over 11 years ago

I looked at the original log carefully and now we have reproduction:
V-C-select RFQ-Enter (RFQ server should be running)
At this point the following warnings pop up:

[11/28/2012 15:26:01 EST] (org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator:WARN) HHH000208: org.hibernate.connection.DriverManagerConnectionProvider has been deprecated in favor of org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl; that provider will be used instead.
[11/28/2012 15:26:01 EST] (org.hibernate.type.TypeFactory$TypeScopeImpl:WARN) HHH000233: Scoping types to session factory org.hibernate.internal.SessionFactoryImpl@6097839c after already scoped org.hibernate.internal.SessionFactoryImpl@119b5283

then 2-F4 to main menu and exit Majic:
com.goldencode.p2j.persist.PersistenceException: [00000006:00000034:syman-->lightning.timco.aero/10.114.1.99:3433/majic/primary] error closing Hibernate session ....

No comments so far.

#43 Updated by Eric Faulhaber over 11 years ago

When those first warnings appear in the log, is it just the messages themselves, or is there any associated stack trace that could help us identify the moment where things start to go wrong?

#44 Updated by Stanislav Lomany over 11 years ago

When those first warnings appear in the log, is it just the messages themselves, or is there any associated stack trace that could help us identify the moment where things start to go wrong?

I'm trying to figure this out.

#45 Updated by Stanislav Lomany over 11 years ago

The following issue:

[12/02/2012 13:30:49 MSK] (net.sf.ehcache.store.disk.DiskStorageFactory$DiskWriteTask:SEVERE) Disk Write of sql: select redstonedo0_.id as col_0_0_ from redstone_domain redstonedo0_ where redstonedo0_.id=?; parameters: 0x15DA, ; named parameters: {}; max rows: 2; transformer: org.hibernate.transform.CacheableResultTransformer@110f2 failed: 
java.io.NotSerializableException: rowid
        at com.goldencode.p2j.util.rowid.writeExternal(rowid.java:430)
        at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1429)
        at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1398)
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
        at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346)
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154)
        at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
        at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
        at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
        at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
        at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:422)
        at net.sf.ehcache.Element.writeObject(Element.java:835)
        at sun.reflect.GeneratedMethodAccessor77.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
        at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
        at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
        at net.sf.ehcache.util.MemoryEfficientByteArrayOutputStream.serialize(MemoryEfficientByteArrayOutputStream.java:97)
        at net.sf.ehcache.store.disk.DiskStorageFactory.serializeElement(DiskStorageFactory.java:405)
        at net.sf.ehcache.store.disk.DiskStorageFactory.write(DiskStorageFactory.java:384)
        at net.sf.ehcache.store.disk.DiskStorageFactory$DiskWriteTask.call(DiskStorageFactory.java:485)
        at net.sf.ehcache.store.disk.DiskStorageFactory$PersistentDiskWriteTask.call(DiskStorageFactory.java:1088)
        at net.sf.ehcache.store.disk.DiskStorageFactory$PersistentDiskWriteTask.call(DiskStorageFactory.java:1072)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)

was fixed by implementing functions of Externalizable interface in rowid:
public void readExternal(ObjectInput in)
   throws IOException,
          ClassNotFoundException
   {
      value = in.readLong();
   }

   public void writeExternal(ObjectOutput out)
   throws IOException
   {
      out.writeLong(value);
   }

#46 Updated by Stanislav Lomany over 11 years ago

1.

[11/28/2012 15:26:01 EST] (org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator:WARN) HHH000208: org.hibernate.connection.DriverManagerConnectionProvider has been deprecated in favor of org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl; that provider will be used instead.

was fixed by pointing the correct provider in DatabaseManager.getRemoteConfiguration:
remoteProps.setProperty(
         Environment.CONNECTION_PROVIDER,
         "org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl");

2.
[11/28/2012 15:26:01 EST] (org.hibernate.type.TypeFactory$TypeScopeImpl:WARN) HHH000233: Scoping types to session factory org.hibernate.internal.SessionFactoryImpl@6097839c after already scoped org.hibernate.internal.SessionFactoryImpl@119b5283

is caused by the following:
// Note that Hibernate configurations are stored by schema,
// which may be shared by more than one physical database.
// This sharing saves us a little time and memory compared to
// recreating the config for every transient connection.  It is
// safe, even though we override properties on subsequent uses,
// because there are no downstream dependencies on the property
// settings of the cached configs, only on the mappings.

Which way should I go to correct this?

3. "error closing Hibernate session" is caused by fact that the session with a remote database is closed on application exit, while the corresponding session factory is closed before that, on explicit disconnect from the remote database. I was looking into the code, but since I'm not advanced in the protocol part, any help is appreciated.
Is it OK that the session with the remote database is associated with the queue that serves client-server communication, not the one which serves server-remote_server connection?

#47 Updated by Stanislav Lomany over 11 years ago

Warning that appears when multiple servers are executed on the same machine:

[12/03/2012 13:21:49 MSK] (net.sf.ehcache.DiskStorePathManager:WARNING) diskStorePath '/tmp' is already used by an existing CacheManager either in the same VM or in a different process.
The diskStore path for this CacheManager will be set to /tmp/ehcache_auto_created483174597424077681diskstore.
To avoid this warning consider using the CacheManager factory methods to create a singleton CacheManager or specifying a separate ehcache configuration (ehcache.xml) for each CacheManager instance.

#48 Updated by Constantin Asofiei over 11 years ago

3. "error closing Hibernate session" is caused by fact that the session with a remote database is closed on application exit, while the corresponding session factory is closed before that, on explicit disconnect from the remote database. I was looking into the code, but since I'm not advanced in the protocol part, any help is appreciated.

The root cause might be because the ConnectionManager.local.cleanup is executed before the Persistence.Context.cleanup (for the remote server). Please test by placing breakpoints in these methods and debug to see the order in which they get called. Also, if you have a recreate scenario, please share it.

Is it OK that the session with the remote database is associated with the queue that serves client-server communication, not the one which serves server-remote_server connection?

I don't think I understand this one... by "session" you mean Hibernate session to access the remote database or the P2J session to access the remote database ? Can you please elaborate a little ?

#49 Updated by Stanislav Lomany over 11 years ago

The root cause might be because the ConnectionManager.local.cleanup is executed before the Persistence.Context.cleanup (for the remote server). Please test by placing breakpoints in these methods and debug to see the order in which they get called.

Persistence.Context.cleanup is called on application exit. After it ConnectionManager.local.cleanup is called, but at that point it doesn't contain connection with the remote server.
I think the problem is that we should call Persistence.Context.cleanup as long as a remote database was disconnected, say, with ConnectionManager.disconnect.

Also, if you have a recreate scenario, please share it.

Please see post # 42 above.

#50 Updated by Eric Faulhaber over 11 years ago

Stanislav Lomany wrote:

[11/28/2012 15:26:01 EST] (org.hibernate.type.TypeFactory$TypeScopeImpl:WARN) HHH000233: Scoping types to session factory org.hibernate.internal.SessionFactoryImpl@6097839c after already scoped org.hibernate.internal.SessionFactoryImpl@119b5283

What "type" resource was scoped to one SessionFactory that is now being scoped to another? In other words, what resource specifically is Hibernate complaining about here? When does this happen -- when a transient database has been connected, disconnected, and is now being reconnected? Or something else?

#51 Updated by Stanislav Lomany over 11 years ago

What "type" resource was scoped to one SessionFactory that is now being scoped to another? In other words, what resource specifically is Hibernate complaining about here? When does this happen -- when a transient database has been connected, disconnected, and is now being reconnected? Or something else?

This warning occurs if for a TypeFactory ("Used internally to obtain instances of Type") the target SessionFactory was re-assigned. SessionFactory is used by TypeFactory in order to return "type scope" which is used somehow by Hibernate internals.
It happens when Configuration (specifically Configuration.typeResolver) was re-used, i.e. on connection of a remote database which schema matches the schema of the local permanent database.

#52 Updated by Eric Faulhaber over 11 years ago

OK, it sounds like caching the Hibernation Configuration objects by schema is no longer a safe thing to do with this version of Hibernate. I guess we will have to cache them by physical database instead (along with the SessionFactory, which is already cached so). If this still doesn't work, we'll have to generate a new Configuration object each time from the Hibernate properties, but as I recall, that is a pretty expensive operation.

#53 Updated by Stanislav Lomany over 11 years ago

About

Caused by: org.hibernate.HibernateException: Found two representations of same collection: aero.timco.majic.dmo.majic.impl.CrossReferenceItemImpl.composite4

The reproduction is:
1. I
2. X
3. Make sure that at least one alternate description exist, if not - press A to add one
4. U
5. F1 - error appears
At first the following error (# 1) is displayed:
(ErrorManager:SEVERE) {00000001:0000001D:syman} ** crossReferenceItem already exists with item 000300001 rank 1. (132)

which is incorrect. Then the stacktrace of the "Found two representations" error (# 2) follows.

Basically, the Majic code does the following:
1. deletes the entity
2. creates the same (or almost same) entity - validation against dirty database fails (# 1) and rollback is executed
3. rollback fails because of # 2

So potentially there are two issues here.

#54 Updated by Eric Faulhaber over 11 years ago

Good work on finding a reliable recreate. Please open a new bug issue in the database project for this error, but don't work on it (it appears unrelated to the Hibernate version upgrade).

It seems you've been finding (and fixing) some new issues in the past few days. Do you have a good idea what's left to be done on this task at this point?

#55 Updated by Stanislav Lomany over 11 years ago

Good work on finding a reliable recreate. Please open a new bug issue in the database project for this error, but don't work on it (it appears unrelated to the Hibernate version upgrade).

I think at least issue # 1 is related to Hibernate because is doesn't present in the original environment. I guess something on how Hibernate handles deleted but uncommitted records.

It seems you've been finding (and fixing) some new issues in the past few days. Do you have a good idea what's left to be done on this task at this point?

1. "Found two representations" issue(s).
2. Session factory scoping - store Configuration by database.
3. "error closing Hibernate session" - probably we should clean up persistence context when a remote database is disconnected.
4. "diskStorePath '/tmp' is already used by an existing CacheManager either in the same VM or in a different process." warning - should I configure CacheManager?
5. "Positional parameter are considered deprecated" warnings.
6. "(net.sf.ehcache.config.ConfigurationFactory:WARNING) No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/home/svl/updates/1580-hibernate/ehcache-core-2.6.2.jar!/ehcache-failsafe.xml" - should I fix it?

#56 Updated by Stanislav Lomany over 11 years ago

About "Found two representations". After I've inserted the following code right after deletion of the target item the problem disappeared.

RecordBuffer.delete(crossReferenceItem);

try
{
   Persistence.get("majic").list("SELECT item.id FROM CrossReferenceItemImpl item WHERE item.item like '%000300001%'", new Object[0], new org.hibernate.type.Type[0], 100, 0, true);
}
catch (PersistenceException e)
{
  e.printStackTrace();  
}

So I guess it is some Hibernate session state issues. I probably should go and check whether I've downloaded a stable release. Any more ideas?

#57 Updated by Eric Faulhaber over 11 years ago

I'm not so sure this behavior is about an unstable release. But I think you are right that the select statement is probably changing something about about the internal state of the session in a way that alleviates this problem. This is only something that happens with collections (which we use for extent field emulation), and it is probably related to the fact that we have told Hibernate to be lazy about loading these collections (in the hbm.xml files). The trick is knowing what that change is and determining whether we need to trigger that same change in a more deterministic way (i.e., not as the side effect of a select), when, and why.

#58 Updated by Eric Faulhaber over 11 years ago

Stanislav Lomany wrote:

6. "(net.sf.ehcache.config.ConfigurationFactory:WARNING) No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/home/svl/updates/1580-hibernate/ehcache-core-2.6.2.jar!/ehcache-failsafe.xml" - should I fix it?

Yes, this needs to be fixed, but I'm not sure what the issue is here. In build.xml, we copy the ehcache configuration file ehcache_production.xml (as ehcache.xml) into the build/classes subdirectory, then we jar it up into majic.jar, so it should be in the classpath when the jar is loaded. Has the naming convention or required location of this configuration file changed?

#59 Updated by Stanislav Lomany over 11 years ago

Yes, this needs to be fixed, but I'm not sure what the issue is here. In build.xml, we copy the ehcache configuration file ehcache_production.xml (as ehcache.xml) into the build/classes subdirectory, then we jar it up into majic.jar, so it should be in the classpath when the jar is loaded. Has the naming convention or required location of this configuration file changed?

Sorry, this and CacheManager configuration issues were only related to my local environment, it is OK in production.

#60 Updated by Stanislav Lomany over 11 years ago

About "Found two representations"-related issues:
1. In the first issue ("crossReferenceItem already exists with") problem also can be eliminated by flushing session after deletion:

RecordBuffer.delete(crossReferenceItem);

Persistence.get("majic").getSession().flush();

Anyway, I've debugged the Hibernate and found that the problem is about that further down the code the validation query passed to JDBC returns deleted item.
2. "Found two representations" is an issue about our rollback mechanism (we handle collections improperly somehow) or it is about in-Hibernate session context.
I'm working on these issues.

#61 Updated by Stanislav Lomany over 11 years ago

The "crossReferenceItem already exists with" issue is about Session.contains function. In Hibernate 4 it returns FALSE if the entity is kept in the session context, but enqueued for deletion or was actually deleted from the database:

public boolean contains(Object object) {
   errorIfClosed();
   checkTransactionSynchStatus();
   if ( object instanceof HibernateProxy ) {
      //do not use proxiesByKey, since not all
      //proxies that point to this session's
      //instances are in that collection!
      LazyInitializer li = ( (HibernateProxy) object ).getHibernateLazyInitializer();
      if ( li.isUninitialized() ) {
          //if it is an uninitialized proxy, pointing
      //with this session, then when it is accessed,
      //the underlying instance will be "contained" 
      return li.getSession()==this;
       }
       else {
          //if it is initialized, see if the underlying
      //instance is contained, since we need to
      //account for the fact that it might have been
      //evicted
      object = li.getImplementation();
       }
    }
    // A session is considered to contain an entity only if the entity has
    // an entry in the session's persistence context and the entry reports
    // that the entity has not been removed
    EntityEntry entry = persistenceContext.getEntry( object );
    return entry != null && entry.getStatus() != Status.DELETED && entry.getStatus() != Status.GONE;
}

This function matters when on entity deletion DMO use count drops to 0 and we try to evict it, optionally flushing the session (that flush is the one that is missing for the following dirty check to work correctly):
public void detach(Object object)
throws PersistenceException
{
   Context local = context.get();
   boolean flush = false;
   boolean commit = false;

   try
   {
      Session session = local.getSessionNoCreate();
      if (session != null && session.contains(object))
      {
         Class<?> dmoClass = object.getClass();
         dmoClass = DatabaseManager.normalizeDMOClass(dmoClass);
         flush = local.isFlushRequired(dmoClass.getName());

         if (flush)
         {
            commit = beginTransaction(local);
            session.flush();
         }

         ...

         session.evict(object);
      }
   }

My suggestion is to use instead of Session.contains the function that doesn't check the entity state:
static boolean containedInSession(Object object, Session session)
{
   PersistenceContext persistenceContext =
            ((SessionImpl) session).getPersistenceContext();

   if ( object instanceof HibernateProxy) {
      //do not use proxiesByKey, since not all
      //proxies that point to this session's
      //instances are in that collection!
      LazyInitializer li =
               ( (HibernateProxy) object ).getHibernateLazyInitializer();
      if ( li.isUninitialized() ) {
         //if it is an uninitialized proxy, pointing
     //with this session, then when it is accessed,
     //the underlying instance will be "contained" 
     return li.getSession() == session;
      }
      else {
         //if it is initialized, see if the underlying
     //instance is contained, since we need to
     //account for the fact that it might have been
     //evicted
     object = li.getImplementation();
      }
   }

   EntityEntry entry = persistenceContext.getEntry( object );
   return entry != null;
}

Eviction of an entity in the deleted state seems to be safe if the flush was performed.
There are two more places were Session.contains is used, in both cases if a record exist its lock is downgraded to NONE. As far as I've looked, Hibernate doesn't explicitly downgrade the lock, so these places can be left as is.
Any better ideas appreciated.

#62 Updated by Eric Faulhaber over 11 years ago

Stanislav Lomany wrote:

The "crossReferenceItem already exists with" issue is about Session.contains function. In Hibernate 4 it returns FALSE if the entity is kept in the session context, but enqueued for deletion or was actually deleted from the database:

Did this behavior change from 3.0.5?

Good work tracking this down! Please go ahead and implement as you suggest.

#63 Updated by Stanislav Lomany over 11 years ago

Did this behavior change from 3.0.5?

Yes, 3.0.5 just checks if there is the entity in the persistence context (regardless of the entity state).

#64 Updated by Stanislav Lomany over 11 years ago

Testcase for the "Found two representations of same collection" issue:

do transaction:
  find person where emp-num = 2 and person.site-id = 2.
  delete person.
  undo, leave.
end.

Still debugging it.

#65 Updated by Eric Faulhaber over 11 years ago

Please summarize the current status of all known issues with this task and estimate (if you can) how much effort you think it will take to address them.

#66 Updated by Stanislav Lomany over 11 years ago

1. Found two representations of same collection -- a day, may be two to find the cause and make a solution
2. Session factory scoping warning - store Configuration by database -- a day
3. Error closing Hibernate session -- I should suggest a solution, which can take some time because it is related to Persistence.Context and conversational part of P2J.
4. Positional parameter are considered deprecated warnings -- haven't look deep into it yet.

Also, I'll re-run regression testing with the latest fixes applied to see whether we have any more issues. The issues above shouldn't affect testing process (maybe except RFQ part).

#67 Updated by Stanislav Lomany over 11 years ago

In order to reproduce the "Found two representations of same collection" issue the following Hibernate command sequence can be used (it is almost the same command sequence as in P2J):

Transaction tr = session.beginTransaction();
PersonImpl person = (PersonImpl) session.get(PersonImpl.class, (long)2);

Hibernate.initialize(person.composite5);
session.delete(person);
session.flush();
session.evict(person);
session.save(person);

tr.commit();

Practically, in Hibernate 4 an entity with a collection cannot be saved (even in another transaction) after it has been deleted, while it was working in Hibernate 3. However we can work this around in this way:
Transaction tr = session.beginTransaction();
PersonImpl person = (PersonImpl) session.get(PersonImpl.class, (long)2);

Hibernate.initialize(person.composite5);
session.delete(person);
session.flush();
session.evict(person);
session.merge(person);

tr.commit();

Eric, any ideas?

#68 Updated by Eric Faulhaber over 11 years ago

Sorry, I don't understand what your workaround example is trying to accomplish. What use case in P2J does this represent?

#69 Updated by Constantin Asofiei over 11 years ago

Stas/Eric, just a thought: do you see the "Found two representations of same collection" issue any way related to the UniqueConstraintViolation error (on the parent__id and list__index columns for a composite table) TIMCO has been seeing in MAJIC now and then ?

#70 Updated by Constantin Asofiei over 11 years ago

PS: see the stacktrace in the #1566 bug.

#71 Updated by Stanislav Lomany over 11 years ago

Eric, the snippet represents the process of deletion and the following rollback of an entity in P2J (during rollback it is re-inserted). What I suggest is to use merge instead save for ReversibleDelete, at least for entities with collections.

Constantin, this issue is only about Hibernate 4, so I doubt about it.

#72 Updated by Eric Faulhaber over 11 years ago

OK, let's try it. Can you think of an easy (generic) way to determine when an entity has a collection, or do you propose to use merge in ReversibleDelete always? Is there any harm in doing so?

#73 Updated by Stanislav Lomany over 11 years ago

OK, let's try it. Can you think of an easy (generic) way to determine when an entity has a collection, or do you propose to use merge in ReversibleDelete always? Is there any harm in doing so?

In order to determine when an entity has a collection we can analyze its PersistentClass and cache the decision. As far as I looked, there is no harm of using merge for all entities. However there are two tricky things:
1. Merge returns a new entity attached to session, the old entity remains detached. I used RecordBuffer.setCurrentRecord in order to use the merged record instead the old one.
2. We have to be sure that a collection was initialized before the parent entity was deleted, otherwise we will silently get incorrect data. As far as I've looked collections are already initialized at that point without additional efforts, but I'll still be looking into it.

Recent regression testing showed two new issues:
1. Reproduction: F - V - A

Caused by: java.lang.NullPointerException
        at org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler.getResourceRegistry(ConnectionProxyHandler.java:104)
        at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.getResourceRegistry(AbstractStatementProxyHandler.java:73)
        at org.hibernate.engine.jdbc.internal.proxy.ResultSetProxyHandler.getResourceRegistry(ResultSetProxyHandler.java:62)
        at org.hibernate.engine.jdbc.internal.proxy.AbstractResultSetProxyHandler.explicitClose(AbstractResultSetProxyHandler.java:116)
        at org.hibernate.engine.jdbc.internal.proxy.AbstractResultSetProxyHandler.continueInvocation(AbstractResultSetProxyHandler.java:76)
        at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81)
        at $Proxy6.close(Unknown Source)
        at aero.timco.majic.po.QaVendorUtils.suggestNextVendorNumber(QaVendorUtils.java:269)
        at aero.timco.majic.po.Vend$1$1$1$3$8.body(Vend.java:1391)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8039)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7848)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:830)
        at aero.timco.majic.po.Vend$1$1$1$3.body(Vend.java:1387)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8039)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7933)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1499)
        at aero.timco.majic.po.Vend$1$1$1.body(Vend.java:294)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.doBlockWorker(BlockManager.java:7700)
        at com.goldencode.p2j.util.BlockManager.doBlock(BlockManager.java:484)
        at aero.timco.majic.po.Vend$1$1.body(Vend.java:219)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8039)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7933)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1499)
        at aero.timco.majic.po.Vend$1.body(Vend.java:210)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6890)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:194)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:180)
        at aero.timco.majic.po.Vend.execute(Vend.java:125)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:229)
        at aero.timco.majic.menu.Call$1$2.body(Call.java:173)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8039)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7848)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:683)
        at aero.timco.majic.menu.Call$1.body(Call.java:103)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6890)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:194)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:180)
        at aero.timco.majic.menu.Call.execute(Call.java:34)
        at aero.timco.majic.menu.Call$1$2.body(Call.java:256)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8039)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7848)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:683)
        at aero.timco.majic.menu.Call$1.body(Call.java:103)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6890)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:194)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:180)
        at aero.timco.majic.menu.Call.execute(Call.java:34)
        at aero.timco.majic.menu.Majic$1$1.body(Majic.java:170)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8039)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7933)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1579)
        at aero.timco.majic.menu.Majic$1.body(Majic.java:63)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6890)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:194)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:180)
        at aero.timco.majic.menu.Majic.execute(Majic.java:31)
        at sun.reflect.GeneratedMethodAccessor824.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.Utils.invoke(Utils.java:1153)
        at com.goldencode.p2j.main.StandardServer$MainInvoker.execute(StandardServer.java:1513)
        at com.goldencode.p2j.main.StandardServer.invoke(StandardServer.java:1019)
        at com.goldencode.p2j.main.StandardServer.standardEntry(StandardServer.java:320)
        at sun.reflect.GeneratedMethodAccessor823.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.MethodInvoker.invoke(MethodInvoker.java:76)
        at com.goldencode.p2j.net.Dispatcher.processInbound(Dispatcher.java:675)
        at com.goldencode.p2j.net.Conversation.block(Conversation.java:316)
        at com.goldencode.p2j.net.Conversation.run(Conversation.java:158)
        at java.lang.Thread.run(Thread.java:619)

2. No reproduction so far.

[12/24/2012 15:56:12 EST] (com.goldencode.p2j.persist.Persistence$Context:WARNING) [0000004A:000000FF:syman-->local/majic/primary] rolling back open transaction during context cleanup
[12/24/2012 15:56:12 EST] (com.goldencode.p2j.persist.Persistence$Context:WARNING) [0000004A:000000FF:syman-->local/_temp/primary] rolling back open transaction during context cleanup
[12/24/2012 15:56:12 EST] (com.goldencode.p2j.persist.Persistence$Context:WARNING) [0000004A:000000FF:syman-->local/_temp/primary] rolling back orphaned transaction
[12/24/2012 15:56:12 EST] (com.goldencode.p2j.persist.Persistence$Context:SEVERE) Error closing Hibernate session during context cleanup
com.goldencode.p2j.persist.PersistenceException: [0000004A:000000FF:syman-->local/_temp/primary] unable to rollback current transaction
        at com.goldencode.p2j.persist.Persistence$Context.rollback(Persistence.java:4093)
        at com.goldencode.p2j.persist.Persistence$Context.closeSession(Persistence.java:4573)
        at com.goldencode.p2j.persist.Persistence$Context.rollback(Persistence.java:4091)
        at com.goldencode.p2j.persist.Persistence$Context.cleanup(Persistence.java:4819)
        at com.goldencode.p2j.persist.Persistence$1.cleanup(Persistence.java:595)
        at com.goldencode.p2j.persist.Persistence$1.cleanup(Persistence.java:593)
        at com.goldencode.p2j.security.ContextLocal$Wrapper.cleanup(ContextLocal.java:367)
        at com.goldencode.p2j.security.SecurityContext.cleanup(SecurityContext.java:437)
        at com.goldencode.p2j.security.SecurityManager.endContext(SecurityManager.java:6710)
        at com.goldencode.p2j.security.SecurityManager.popContextWorker(SecurityManager.java:6648)
        at com.goldencode.p2j.security.SecurityManager.popAndRestoreSecurityContext(SecurityManager.java:3885)
        at com.goldencode.p2j.net.RouterSessionManager.restoreContext(RouterSessionManager.java:1041)
        at com.goldencode.p2j.net.Queue.stop(Queue.java:414)
        at com.goldencode.p2j.net.Protocol$Reader.run(Protocol.java:416)
        at java.lang.Thread.run(Thread.java:619)
Caused by: org.hibernate.TransactionException: rollback failed
        at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.rollback(AbstractTransactionImpl.java:215)
        at com.goldencode.p2j.persist.Persistence$Context.rollback(Persistence.java:4080)
        at com.goldencode.p2j.persist.Persistence$Context.closeSession(Persistence.java:4573)
        at com.goldencode.p2j.persist.Persistence$Context.rollback(Persistence.java:4091)
        at com.goldencode.p2j.persist.Persistence$Context.cleanup(Persistence.java:4819)
        at com.goldencode.p2j.persist.Persistence$1.cleanup(Persistence.java:595)
        at com.goldencode.p2j.persist.Persistence$1.cleanup(Persistence.java:593)
        at com.goldencode.p2j.security.ContextLocal$Wrapper.cleanup(ContextLocal.java:367)
        at com.goldencode.p2j.security.SecurityContext.cleanup(SecurityContext.java:437)
        at com.goldencode.p2j.security.SecurityManager.endContext(SecurityManager.java:6710)
        at com.goldencode.p2j.security.SecurityManager.popContextWorker(SecurityManager.java:6648)
        at com.goldencode.p2j.security.SecurityManager.popAndRestoreSecurityContext(SecurityManager.java:3885)
        at com.goldencode.p2j.net.RouterSessionManager.restoreContext(RouterSessionManager.java:1041)
        at com.goldencode.p2j.net.Queue.stop(Queue.java:414)
        at com.goldencode.p2j.net.Protocol$Reader.run(Protocol.java:416)
        at java.lang.Thread.run(Thread.java:619)
Caused by: org.hibernate.TransactionException: unable to rollback against JDBC connection
        at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.doRollback(JdbcTransaction.java:167)
        at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.rollback(AbstractTransactionImpl.java:209)
        at com.goldencode.p2j.persist.Persistence$Context.rollback(Persistence.java:4080)
        at com.goldencode.p2j.persist.Persistence$Context.closeSession(Persistence.java:4573)
        at com.goldencode.p2j.persist.Persistence$Context.rollback(Persistence.java:4091)
        at com.goldencode.p2j.persist.Persistence$Context.cleanup(Persistence.java:4819)
        at com.goldencode.p2j.persist.Persistence$1.cleanup(Persistence.java:595)
        at com.goldencode.p2j.persist.Persistence$1.cleanup(Persistence.java:593)
        at com.goldencode.p2j.security.ContextLocal$Wrapper.cleanup(ContextLocal.java:367)
        at com.goldencode.p2j.security.SecurityContext.cleanup(SecurityContext.java:437)
        at com.goldencode.p2j.security.SecurityManager.endContext(SecurityManager.java:6710)
        at com.goldencode.p2j.security.SecurityManager.popContextWorker(SecurityManager.java:6648)
        at com.goldencode.p2j.security.SecurityManager.popAndRestoreSecurityContext(SecurityManager.java:3885)
        at com.goldencode.p2j.net.RouterSessionManager.restoreContext(RouterSessionManager.java:1041)
        at com.goldencode.p2j.net.Queue.stop(Queue.java:414)
        at com.goldencode.p2j.net.Protocol$Reader.run(Protocol.java:416)
        at java.lang.Thread.run(Thread.java:619)
Caused by: org.h2.jdbc.JdbcSQLException: The object is already closed [90007-169]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
        at org.h2.message.DbException.get(DbException.java:169)
        at org.h2.message.DbException.get(DbException.java:146)
        at org.h2.message.DbException.get(DbException.java:135)
        at org.h2.jdbc.JdbcConnection.checkClosed(JdbcConnection.java:1386)
        at org.h2.jdbc.JdbcConnection.checkClosedForWrite(JdbcConnection.java:1374)
        at org.h2.jdbc.JdbcConnection.rollback(JdbcConnection.java:460)
        at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.doRollback(JdbcTransaction.java:163)
        at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.rollback(AbstractTransactionImpl.java:209)
        at com.goldencode.p2j.persist.Persistence$Context.rollback(Persistence.java:4080)
        at com.goldencode.p2j.persist.Persistence$Context.closeSession(Persistence.java:4573)
        at com.goldencode.p2j.persist.Persistence$Context.rollback(Persistence.java:4091)
        at com.goldencode.p2j.persist.Persistence$Context.cleanup(Persistence.java:4819)
        at com.goldencode.p2j.persist.Persistence$1.cleanup(Persistence.java:595)
        at com.goldencode.p2j.persist.Persistence$1.cleanup(Persistence.java:593)
        at com.goldencode.p2j.security.ContextLocal$Wrapper.cleanup(ContextLocal.java:367)
        at com.goldencode.p2j.security.SecurityContext.cleanup(SecurityContext.java:437)
        at com.goldencode.p2j.security.SecurityManager.endContext(SecurityManager.java:6710)
        at com.goldencode.p2j.security.SecurityManager.popContextWorker(SecurityManager.java:6648)
        at com.goldencode.p2j.security.SecurityManager.popAndRestoreSecurityContext(SecurityManager.java:3885)
        at com.goldencode.p2j.net.RouterSessionManager.restoreContext(RouterSessionManager.java:1041)
        at com.goldencode.p2j.net.Queue.stop(Queue.java:414)
        at com.goldencode.p2j.net.Protocol$Reader.run(Protocol.java:416)
        at java.lang.Thread.run(Thread.java:619)

#74 Updated by Eric Faulhaber over 11 years ago

Please be careful in making any changes to code which initializes collections; I originally tried to make the initialization of collections lazy, to avoid pulling over a lot more data than we need to in many cases. These days, we only use collections for normalized extent fields; however, some of these can be big (there is one case in Majic which has an extent of 75), so we only want to initialize these collections when we need to read from or write to the extent fields.

#75 Updated by Eric Faulhaber over 11 years ago

Stanislav Lomany wrote:

1. Reproduction: F - V - A

...
org.hibernate.engine.jdbc.internal.proxy.AbstractResultSetProxyHandler.continueInvocation(AbstractResultSetProxyHandler.java:76)
        at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81)
        at $Proxy6.close(Unknown Source)
        at aero.timco.majic.po.QaVendorUtils.suggestNextVendorNumber(QaVendorUtils.java:269)
...

What version of QaVendorUtils are you using? There is no ResultSet.close() call at line 269 in my version (004). Keep in mind this is one-off, hand-written Java code. In version 003, I added some transaction processing code which may affect this issue.

#76 Updated by Stanislav Lomany over 11 years ago

What version of QaVendorUtils are you using? There is no ResultSet.close() call at line 269 in my version (004). Keep in mind this is one-off, hand-written Java code. In version 003, I added some transaction processing code which may affect this issue.

I'm using 002 - the one from the staging. I'll get the latest one.

#77 Updated by Stanislav Lomany over 11 years ago

1.

Please be careful in making any changes to code which initializes collections; I originally tried to make the initialization of collections lazy, to avoid pulling over a lot more data than we need to in many cases. These days, we only use collections for normalized extent fields; however, some of these can be big (there is one case in Majic which has an extent of 75), so we only want to initialize these collections when we need to read from or write to the extent fields.

Thankfully P2J already initializes lazy extents upon entity deletion.

2.

What version of QaVendorUtils are you using? There is no ResultSet.close() call at line 269 in my version (004). Keep in mind this is one-off, hand-written Java code. In version 003, I added some transaction processing code which may affect this issue.

This issue presents in the version 004 too, I'm looking into it.

3. When you interrupt a long-running query with ctrl-c the following lines are appended to the log:

[12/28/2012 16:33:28 MSK] (org.hibernate.engine.jdbc.spi.SqlExceptionHelper:WARN) SQL Error: 0, SQLState: null
[12/28/2012 16:33:28 MSK] (org.hibernate.engine.jdbc.spi.SqlExceptionHelper:ERROR) An SQLException was provoked by the following failure: java.lang.InterruptedException

E.g. press A - quickly Ctrl-C. We have no problems with that, but probably have to ensure that these lines will not appear in production.
One can catch the logged exception in the "catch (HibernateException exc)" section of the Persistence.load(RecordBuffer, String, Object[], Type[], LockType, boolean, boolean) method.

#78 Updated by Stanislav Lomany over 11 years ago

1. About NPE in suggestNextVendorNumber: strange, but if we use a PreparedStatement which returns a ResultSet in do(Returning)Work, closing that result set causes NPE. My suggesting is to use Session.createSQLQuery instead of do(Returning)Work. Drawback is the API change: SQLQuery returns ScrollableResult instead of ResultSet, plus types of the returned columns should be specified in advance for the query using SQLQuery.addScalar.

2. About Session factory scoping warning: Configuration cannot be re-used for the same database too (i.e. SessionFactory cannot be created twice basing on the same Configuration). So we need to create a new Configuration object each time on registerDatabase. Work of ORMHandler that prepares data for a new Configuration takes long 5 seconds, so I suggest to cache (by schema) Documents created by ORMHandler and use them for creation of a new Configuration object.

#79 Updated by Stanislav Lomany over 11 years ago

About "Error closing Hibernate session": session factory is closed in the context which holds the last session connected to the remote database, so in order to avoid the problem we should close this single session before closing the session factory. I've added the following function to Persistence class:

public void cleanup()
{
   context.get().cleanup();
}

and called this function from DatabaseManager.deregisterDatabase:
...
if (updateTransientRefCount(database, false) == 0)
{
   // clean up local context before closing session factory
   PersistenceFactory.getInstance(database).cleanup();

   synchronized (sessionFactories)
   {
      SessionFactory factory = sessionFactories.remove(database);
      PersistenceFactory.remove(database);

      if (factory != null)
      {
         try
         {
            factory.close();
         }
         catch (HibernateException exc)
         ...

#80 Updated by Stanislav Lomany over 11 years ago

About "Session factory scoping warning": now the XmlDocuments produced by ORMHandler are stored and re-used for databases with the same schema. Connection to a remote database takes on my PC:
  • re-use of the same Configuration (produces warning in Hibernate 4) - 0.6 seconds
  • creation of the Configuration from scratch - 3.5 - 4 seconds
  • creation of the Configuration from the cached XmlDocuments - 1-2 seconds.

#81 Updated by Stanislav Lomany about 11 years ago

At this point I'm aware of the single issue which occurs on SO creation. I'll run regression testing in order to reveal more issues.

[04/08/2013 23:13:15 MSD] (ErrorManager:SEVERE) {00000001:0000001D:syman} stack trace follows
com.goldencode.p2j.persist.PersistenceException: [00000001:0000001D:syman-->local/majic/primary] unable to commit explicit transaction
        at com.goldencode.p2j.persist.Persistence$Context.commit(Persistence.java:4081)
        at com.goldencode.p2j.persist.Persistence.delete(Persistence.java:2924)
        at com.goldencode.p2j.persist.RecordBuffer$ReversibleCreate.rollbackWorker(RecordBuffer.java:8280)
        at com.goldencode.p2j.persist.AbstractReversible.rollback(AbstractReversible.java:122)
        at com.goldencode.p2j.persist.RecordBuffer.rollback(RecordBuffer.java:2841)
        at com.goldencode.p2j.util.TransactionManager.processRollback(TransactionManager.java:4498)
        at com.goldencode.p2j.util.TransactionManager.rollbackWorker(TransactionManager.java:1634)
        at com.goldencode.p2j.util.TransactionManager.rollback(TransactionManager.java:1521)
        at com.goldencode.p2j.util.TransactionManager.rollback(TransactionManager.java:1478)
        at com.goldencode.p2j.util.TransactionManager.abnormalEnd(TransactionManager.java:3247)
        at com.goldencode.p2j.util.TransactionManager.abnormalEnd(TransactionManager.java:3168)
        at com.goldencode.p2j.util.BlockManager.doBlockWorker(BlockManager.java:7776)
        at com.goldencode.p2j.util.BlockManager.doBlock(BlockManager.java:405)
        at aero.timco.majic.so.Service$1$2$1$2.body(Service.java:1909)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7949)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1465)
        at aero.timco.majic.so.Service$1$2$1.body(Service.java:884)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.doBlockWorker(BlockManager.java:7716)
        at com.goldencode.p2j.util.BlockManager.doBlock(BlockManager.java:370)
        at aero.timco.majic.so.Service$1$2.body(Service.java:794)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7949)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1385)
        at aero.timco.majic.so.Service$1.body(Service.java:785)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.so.Service.execute(Service.java:260)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3774)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3097)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2875)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:298)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:284)
        at aero.timco.majic.menu.Call$1$2.body(Call.java:172)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7864)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:569)
        at aero.timco.majic.menu.Call$1.body(Call.java:103)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.menu.Call.execute(Call.java:34)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3774)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3097)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2875)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:298)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:284)
        at aero.timco.majic.menu.Call$1$2.body(Call.java:251)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7864)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:569)
        at aero.timco.majic.menu.Call$1.body(Call.java:103)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.menu.Call.execute(Call.java:34)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3774)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3097)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2875)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:298)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:284)
        at aero.timco.majic.menu.Majic$1$1.body(Majic.java:159)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7949)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1465)
        at aero.timco.majic.menu.Majic$1.body(Majic.java:59)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.menu.Majic.execute(Majic.java:29)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.Utils.invoke(Utils.java:1153)
        at com.goldencode.p2j.main.StandardServer$MainInvoker.execute(StandardServer.java:1513)
        at com.goldencode.p2j.main.StandardServer.invoke(StandardServer.java:1019)
        at com.goldencode.p2j.main.StandardServer.standardEntry(StandardServer.java:320)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.MethodInvoker.invoke(MethodInvoker.java:76)
        at com.goldencode.p2j.net.Dispatcher.processInbound(Dispatcher.java:675)
        at com.goldencode.p2j.net.Conversation.block(Conversation.java:316)
        at com.goldencode.p2j.net.Conversation.run(Conversation.java:158)
        at java.lang.Thread.run(Thread.java:662)
Caused by: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
        at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:81)
        at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:73)
        at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:57)
        at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:3303)
        at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:3506)
        at org.hibernate.action.internal.EntityDeleteAction.execute(EntityDeleteAction.java:100)
        at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:362)
        at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:354)
        at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:280)
        at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:326)
        at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52)
        at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1213)
        at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:402)
        at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101)
        at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:175)
        at com.goldencode.p2j.persist.Persistence$Context.commit(Persistence.java:4052)
        at com.goldencode.p2j.persist.Persistence.delete(Persistence.java:2924)
        at com.goldencode.p2j.persist.RecordBuffer$ReversibleCreate.rollbackWorker(RecordBuffer.java:8280)
        at com.goldencode.p2j.persist.AbstractReversible.rollback(AbstractReversible.java:122)
        at com.goldencode.p2j.persist.RecordBuffer.rollback(RecordBuffer.java:2841)
        at com.goldencode.p2j.util.TransactionManager.processRollback(TransactionManager.java:4498)
        at com.goldencode.p2j.util.TransactionManager.rollbackWorker(TransactionManager.java:1634)
        at com.goldencode.p2j.util.TransactionManager.rollback(TransactionManager.java:1521)
        at com.goldencode.p2j.util.TransactionManager.rollback(TransactionManager.java:1478)
        at com.goldencode.p2j.util.TransactionManager.abnormalEnd(TransactionManager.java:3247)
        at com.goldencode.p2j.util.TransactionManager.abnormalEnd(TransactionManager.java:3168)
        at com.goldencode.p2j.util.BlockManager.doBlockWorker(BlockManager.java:7776)
        at com.goldencode.p2j.util.BlockManager.doBlock(BlockManager.java:405)
        at aero.timco.majic.so.Service$1$2$1$2.body(Service.java:1909)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7949)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1465)
        at aero.timco.majic.so.Service$1$2$1.body(Service.java:884)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.doBlockWorker(BlockManager.java:7716)
        at com.goldencode.p2j.util.BlockManager.doBlock(BlockManager.java:370)
        at aero.timco.majic.so.Service$1$2.body(Service.java:794)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7949)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1385)
        at aero.timco.majic.so.Service$1.body(Service.java:785)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.so.Service.execute(Service.java:260)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3774)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3097)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2875)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:298)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:284)
        at aero.timco.majic.menu.Call$1$2.body(Call.java:172)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7864)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:569)
        at aero.timco.majic.menu.Call$1.body(Call.java:103)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.menu.Call.execute(Call.java:34)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3774)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3097)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2875)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:298)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:284)
        at aero.timco.majic.menu.Call$1$2.body(Call.java:251)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7864)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:569)
        at aero.timco.majic.menu.Call$1.body(Call.java:103)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.menu.Call.execute(Call.java:34)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3774)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3097)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2875)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:298)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:284)
        at aero.timco.majic.menu.Majic$1$1.body(Majic.java:159)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7949)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1465)
        at aero.timco.majic.menu.Majic$1.body(Majic.java:59)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.menu.Majic.execute(Majic.java:29)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.Utils.invoke(Utils.java:1153)
        at com.goldencode.p2j.main.StandardServer$MainInvoker.execute(StandardServer.java:1513)
        at com.goldencode.p2j.main.StandardServer.invoke(StandardServer.java:1019)
        at com.goldencode.p2j.main.StandardServer.standardEntry(StandardServer.java:320)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.MethodInvoker.invoke(MethodInvoker.java:76)
        at com.goldencode.p2j.net.Dispatcher.processInbound(Dispatcher.java:675)
        at com.goldencode.p2j.net.Conversation.block(Conversation.java:316)
        at com.goldencode.p2j.net.Conversation.run(Conversation.java:158)
        at java.lang.Thread.run(Thread.java:662)

#82 Updated by Eric Faulhaber about 11 years ago

Please post an update including your work so far, so I can begin reviewing.

#84 Updated by Stanislav Lomany about 11 years ago

  • File svl_test20130410b.zip added

#85 Updated by Stanislav Lomany about 11 years ago

lib/hibernate3.jar and lib/ehcache-1.1.jar should be removed.

#87 Updated by Stanislav Lomany about 11 years ago

SO creation error was related to already solved boolean literal rendering issue, it turned out that one file was merged incorrectly. I'll run regression testing ASAP.

#88 Updated by Stanislav Lomany about 11 years ago

Issue 1:
Reproduction:
V - O - 1 - W - 2
Data to enter:
283338
3.1.5
3.2.2
34000
35000

Stacktrace:

[04/15/2013 23:58:18 MSD] (ErrorManager:SEVERE) {00000001:0000001D:syman} stack trace follows
com.goldencode.p2j.persist.PersistenceException: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [aero.timco.majic.dmo.majic.impl.JobTransactionHeaderImpl#114079904]
        at com.goldencode.p2j.persist.RecordBuffer$Handler.invoke(RecordBuffer.java:7682)
        at com.goldencode.p2j.persist.$__Proxy73.getTotalHours(Unknown Source)
        at aero.timco.majic.so.JobTot$1$1$1.body(JobTot.java:559)
        at com.goldencode.p2j.util.BlockManager.processForBody(BlockManager.java:6990)
        at com.goldencode.p2j.util.BlockManager.forEachWorker(BlockManager.java:8485)
        at com.goldencode.p2j.util.BlockManager.forEach(BlockManager.java:3708)
        at aero.timco.majic.so.JobTot$1$1.body(JobTot.java:534)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.doBlockWorker(BlockManager.java:7716)
        at com.goldencode.p2j.util.BlockManager.doBlock(BlockManager.java:489)
        at aero.timco.majic.so.JobTot$1.body(JobTot.java:150)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.so.JobTot.execute(JobTot.java:82)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3776)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3099)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2878)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:301)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:287)
        at aero.timco.majic.util.WbcMov$1$1$3$1.body(WbcMov.java:511)
        at com.goldencode.p2j.util.BlockManager.processForBody(BlockManager.java:6990)
        at com.goldencode.p2j.util.BlockManager.forEachWorker(BlockManager.java:8485)
        at com.goldencode.p2j.util.BlockManager.forEach(BlockManager.java:3647)
        at aero.timco.majic.util.WbcMov$1$1$3.body(WbcMov.java:491)
        at com.goldencode.p2j.util.BlockManager.processForBody(BlockManager.java:6990)
        at com.goldencode.p2j.util.BlockManager.forEachWorker(BlockManager.java:8485)
        at com.goldencode.p2j.util.BlockManager.forEach(BlockManager.java:3708)
        at aero.timco.majic.util.WbcMov$1$1.body(WbcMov.java:445)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7949)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1465)
        at aero.timco.majic.util.WbcMov$1.body(WbcMov.java:192)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.util.WbcMov.execute(WbcMov.java:85)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3776)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3099)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2878)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:301)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:287)
        at aero.timco.majic.menu.Call$1$2.body(Call.java:172)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7864)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:569)
        at aero.timco.majic.menu.Call$1.body(Call.java:103)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.menu.Call.execute(Call.java:34)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3776)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3099)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2878)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:301)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:287)
        at aero.timco.majic.menu.Call$1$2.body(Call.java:251)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7864)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:569)
        at aero.timco.majic.menu.Call$1.body(Call.java:103)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.menu.Call.execute(Call.java:34)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3776)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3099)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2878)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:301)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:287)
        at aero.timco.majic.menu.Call$1$2.body(Call.java:251)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7864)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:569)
        at aero.timco.majic.menu.Call$1.body(Call.java:103)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.menu.Call.execute(Call.java:34)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3776)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3099)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2878)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:301)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:287)
        at aero.timco.majic.menu.Call$1$2.body(Call.java:251)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7864)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:569)
        at aero.timco.majic.menu.Call$1.body(Call.java:103)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.menu.Call.execute(Call.java:34)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3776)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3099)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2878)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:301)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:287)
        at aero.timco.majic.menu.Majic$1$1.body(Majic.java:159)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7949)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1465)
        at aero.timco.majic.menu.Majic$1.body(Majic.java:59)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.menu.Majic.execute(Majic.java:29)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.Utils.invoke(Utils.java:1153)
        at com.goldencode.p2j.main.StandardServer$MainInvoker.execute(StandardServer.java:1513)
        at com.goldencode.p2j.main.StandardServer.invoke(StandardServer.java:1019)
        at com.goldencode.p2j.main.StandardServer.standardEntry(StandardServer.java:320)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.MethodInvoker.invoke(MethodInvoker.java:76)
        at com.goldencode.p2j.net.Dispatcher.processInbound(Dispatcher.java:675)
        at com.goldencode.p2j.net.Conversation.block(Conversation.java:316)
        at com.goldencode.p2j.net.Conversation.run(Conversation.java:158)
        at java.lang.Thread.run(Thread.java:662)
Caused by: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [aero.timco.majic.dmo.majic.impl.JobTransactionHeaderImpl#114079904]
        at org.hibernate.engine.internal.StatefulPersistenceContext.checkUniqueness(StatefulPersistenceContext.java:691)
        at org.hibernate.event.internal.AbstractReassociateEventListener.reassociate(AbstractReassociateEventListener.java:72)
        at org.hibernate.event.internal.DefaultLockEventListener.onLock(DefaultLockEventListener.java:81)
        at org.hibernate.internal.SessionImpl.fireLock(SessionImpl.java:810)
        at org.hibernate.internal.SessionImpl.lock(SessionImpl.java:795)
        at com.goldencode.p2j.persist.RecordBuffer$Handler.invoke(RecordBuffer.java:7678)
        at com.goldencode.p2j.persist.$__Proxy73.getTotalHours(Unknown Source)
        at aero.timco.majic.so.JobTot$1$1$1.body(JobTot.java:559)
        at com.goldencode.p2j.util.BlockManager.processForBody(BlockManager.java:6990)
        at com.goldencode.p2j.util.BlockManager.forEachWorker(BlockManager.java:8485)
        at com.goldencode.p2j.util.BlockManager.forEach(BlockManager.java:3708)
        at aero.timco.majic.so.JobTot$1$1.body(JobTot.java:534)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.doBlockWorker(BlockManager.java:7716)
        at com.goldencode.p2j.util.BlockManager.doBlock(BlockManager.java:489)
        at aero.timco.majic.so.JobTot$1.body(JobTot.java:150)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.so.JobTot.execute(JobTot.java:82)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3776)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3099)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2878)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:301)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:287)
        at aero.timco.majic.util.WbcMov$1$1$3$1.body(WbcMov.java:511)
        at com.goldencode.p2j.util.BlockManager.processForBody(BlockManager.java:6990)
        at com.goldencode.p2j.util.BlockManager.forEachWorker(BlockManager.java:8485)
        at com.goldencode.p2j.util.BlockManager.forEach(BlockManager.java:3647)
        at aero.timco.majic.util.WbcMov$1$1$3.body(WbcMov.java:491)
        at com.goldencode.p2j.util.BlockManager.processForBody(BlockManager.java:6990)
        at com.goldencode.p2j.util.BlockManager.forEachWorker(BlockManager.java:8485)
        at com.goldencode.p2j.util.BlockManager.forEach(BlockManager.java:3708)
        at aero.timco.majic.util.WbcMov$1$1.body(WbcMov.java:445)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7949)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1465)
        at aero.timco.majic.util.WbcMov$1.body(WbcMov.java:192)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.util.WbcMov.execute(WbcMov.java:85)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3776)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3099)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2878)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:301)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:287)
        at aero.timco.majic.menu.Call$1$2.body(Call.java:172)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7864)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:569)
        at aero.timco.majic.menu.Call$1.body(Call.java:103)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.menu.Call.execute(Call.java:34)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3776)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3099)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2878)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:301)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:287)
        at aero.timco.majic.menu.Call$1$2.body(Call.java:251)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7864)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:569)
        at aero.timco.majic.menu.Call$1.body(Call.java:103)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.menu.Call.execute(Call.java:34)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3776)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3099)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2878)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:301)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:287)
        at aero.timco.majic.menu.Call$1$2.body(Call.java:251)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7864)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:569)
        at aero.timco.majic.menu.Call$1.body(Call.java:103)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.menu.Call.execute(Call.java:34)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3776)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3099)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2878)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:301)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:287)
        at aero.timco.majic.menu.Call$1$2.body(Call.java:251)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7864)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:569)
        at aero.timco.majic.menu.Call$1.body(Call.java:103)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.menu.Call.execute(Call.java:34)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3776)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3099)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2878)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:301)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:287)
        at aero.timco.majic.menu.Majic$1$1.body(Majic.java:159)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7949)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1465)
        at aero.timco.majic.menu.Majic$1.body(Majic.java:59)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.menu.Majic.execute(Majic.java:29)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.Utils.invoke(Utils.java:1153)
        at com.goldencode.p2j.main.StandardServer$MainInvoker.execute(StandardServer.java:1513)
        at com.goldencode.p2j.main.StandardServer.invoke(StandardServer.java:1019)
        at com.goldencode.p2j.main.StandardServer.standardEntry(StandardServer.java:320)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.MethodInvoker.invoke(MethodInvoker.java:76)
        at com.goldencode.p2j.net.Dispatcher.processInbound(Dispatcher.java:675)
        at com.goldencode.p2j.net.Conversation.block(Conversation.java:316)
        at com.goldencode.p2j.net.Conversation.run(Conversation.java:158)
        at java.lang.Thread.run(Thread.java:662)

#89 Updated by Stanislav Lomany about 11 years ago

Issue 2:
Reproduction:
4 - C - Y - A
Enter data:
I
1029

Stacktrace:

00:43:30,778  WARN [SqlExceptionHelper]:143 - SQL Error: 0, SQLState: 25P02
00:43:30,779 ERROR [SqlExceptionHelper]:144 - ERROR: current transaction is aborted, commands ignored until end of transaction block
00:43:30,780  WARN [Persistence]:4610 - [00000002:00000021:syman-->local/majic/primary] rolling back orphaned transaction
00:43:30,782 DEBUG [SQL]:104 - update job_transaction set transaction_number=?, job=?, suffix=?, transaction_type=?, transaction_date=?, quantity_complete=?, quantity_scrapped=?, operation_number=?, approved_hours=?, next_operation=?, employee_number=?, crediteddollars=?, start_time=?, end_time=?, indirect_code=?, pay_rate=?, quantity_moved=?, location=?, user_code=?, close_job=?, issue_parent=?, lot=?, complete_operation=?, pr_rate=?, job_rate=?, shift=?, posted=?, skill_code=?, fix_overhead_t=?, variable_overhead_t=?, service=?, source_code=?, overtime_util_run=?, change_before=?, change_after=?, customer_order_number=?, timco_operation=?, shift_efficiency=?, audit_number=?, crew_code=?, crew_seq=?, man_code=?, days_off=?, hi_hours=?, low_hours=?, auth_employee=?, batch_flag=?, turn_number=? where id=?
[04/16/2013 00:43:31 MSD] (ErrorManager:SEVERE) {00000002:00000021:syman} stack trace follows
com.goldencode.p2j.persist.PersistenceException: [00000002:00000021:syman-->local/majic/primary] error beginning database transaction
        at com.goldencode.p2j.persist.Persistence$Context.beginTransaction(Persistence.java:4202)
        at com.goldencode.p2j.persist.Persistence.beginTransaction(Persistence.java:3793)
        at com.goldencode.p2j.persist.Persistence.flush(Persistence.java:3708)
        at com.goldencode.p2j.persist.Persistence.flush(Persistence.java:3680)
        at com.goldencode.p2j.persist.Persistence.flush(Persistence.java:3111)
        at com.goldencode.p2j.persist.RecordBuffer.rollback(RecordBuffer.java:2903)
        at com.goldencode.p2j.util.TransactionManager.processRollback(TransactionManager.java:4498)
        at com.goldencode.p2j.util.TransactionManager.rollbackWorker(TransactionManager.java:1634)
        at com.goldencode.p2j.util.TransactionManager.rollback(TransactionManager.java:1521)
        at com.goldencode.p2j.util.TransactionManager.rollback(TransactionManager.java:1478)
        at com.goldencode.p2j.util.TransactionManager.abnormalEnd(TransactionManager.java:3247)
        at com.goldencode.p2j.util.TransactionManager.abnormalEnd(TransactionManager.java:3168)
        at com.goldencode.p2j.util.BlockManager.doBlockWorker(BlockManager.java:7776)
        at com.goldencode.p2j.util.BlockManager.doBlock(BlockManager.java:489)
        at aero.timco.majic.util.Lbrfix2$1$8.body(Lbrfix2.java:947)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.doBlockWorker(BlockManager.java:7716)
        at com.goldencode.p2j.util.BlockManager.doBlock(BlockManager.java:489)
        at aero.timco.majic.util.Lbrfix2$1.body(Lbrfix2.java:937)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at aero.timco.majic.util.Lbrfix2.execute(Lbrfix2.java:147)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3776)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3099)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2878)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:301)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:287)
        at aero.timco.majic.util.Lbrfix1b$1.body(Lbrfix1b.java:154)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at aero.timco.majic.util.Lbrfix1b.execute(Lbrfix1b.java:74)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3776)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3099)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2878)
        at com.goldencode.p2j.util.ControlFlowOps.invokeWithMode(ControlFlowOps.java:273)
        at com.goldencode.p2j.util.ControlFlowOps.invokeWithMode(ControlFlowOps.java:255)
        at aero.timco.majic.util.Lbrfix1$1$1$11.body(Lbrfix1.java:1815)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.doBlockWorker(BlockManager.java:7716)
        at com.goldencode.p2j.util.BlockManager.doBlock(BlockManager.java:405)
        at aero.timco.majic.util.Lbrfix1$1$1.body(Lbrfix1.java:1811)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7949)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1465)
        at aero.timco.majic.util.Lbrfix1$1.body(Lbrfix1.java:379)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.util.Lbrfix1.execute(Lbrfix1.java:145)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3776)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3099)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2878)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:301)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:287)
        at aero.timco.majic.util.Lbrfix$1$1.body(Lbrfix.java:335)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7949)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1465)
        at aero.timco.majic.util.Lbrfix$1.body(Lbrfix.java:160)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.util.Lbrfix.execute(Lbrfix.java:71)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3776)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3099)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2878)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:301)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:287)
        at aero.timco.majic.menu.Call$1$2.body(Call.java:172)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7864)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:569)
        at aero.timco.majic.menu.Call$1.body(Call.java:103)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.menu.Call.execute(Call.java:34)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3776)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3099)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2878)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:301)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:287)
        at aero.timco.majic.menu.Call$1$2.body(Call.java:251)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7864)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:569)
        at aero.timco.majic.menu.Call$1.body(Call.java:103)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.menu.Call.execute(Call.java:34)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3776)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3099)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2878)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:301)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:287)
        at aero.timco.majic.menu.Majic$1$1.body(Majic.java:159)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7949)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1465)
        at aero.timco.majic.menu.Majic$1.body(Majic.java:59)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.menu.Majic.execute(Majic.java:29)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.Utils.invoke(Utils.java:1153)
        at com.goldencode.p2j.main.StandardServer$MainInvoker.execute(StandardServer.java:1513)
        at com.goldencode.p2j.main.StandardServer.invoke(StandardServer.java:1019)
        at com.goldencode.p2j.main.StandardServer.standardEntry(StandardServer.java:320)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.MethodInvoker.invoke(MethodInvoker.java:76)
        at com.goldencode.p2j.net.Dispatcher.processInbound(Dispatcher.java:675)
        at com.goldencode.p2j.net.Conversation.block(Conversation.java:316)
        at com.goldencode.p2j.net.Conversation.run(Conversation.java:158)
        at java.lang.Thread.run(Thread.java:662)
Caused by: org.hibernate.TransactionException: nested transactions not supported
        at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.begin(AbstractTransactionImpl.java:152)
        at org.hibernate.internal.SessionImpl.beginTransaction(SessionImpl.java:1395)
        at com.goldencode.p2j.persist.Persistence$Context.beginTransaction(Persistence.java:4191)
        at com.goldencode.p2j.persist.Persistence.beginTransaction(Persistence.java:3793)
        at com.goldencode.p2j.persist.Persistence.flush(Persistence.java:3708)
        at com.goldencode.p2j.persist.Persistence.flush(Persistence.java:3680)
        at com.goldencode.p2j.persist.Persistence.flush(Persistence.java:3111)
        at com.goldencode.p2j.persist.RecordBuffer.rollback(RecordBuffer.java:2903)
        at com.goldencode.p2j.util.TransactionManager.processRollback(TransactionManager.java:4498)
        at com.goldencode.p2j.util.TransactionManager.rollbackWorker(TransactionManager.java:1634)
        at com.goldencode.p2j.util.TransactionManager.rollback(TransactionManager.java:1521)
        at com.goldencode.p2j.util.TransactionManager.rollback(TransactionManager.java:1478)
        at com.goldencode.p2j.util.TransactionManager.abnormalEnd(TransactionManager.java:3247)
        at com.goldencode.p2j.util.TransactionManager.abnormalEnd(TransactionManager.java:3168)
        at com.goldencode.p2j.util.BlockManager.doBlockWorker(BlockManager.java:7776)
        at com.goldencode.p2j.util.BlockManager.doBlock(BlockManager.java:489)
        at aero.timco.majic.util.Lbrfix2$1$8.body(Lbrfix2.java:947)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.doBlockWorker(BlockManager.java:7716)
        at com.goldencode.p2j.util.BlockManager.doBlock(BlockManager.java:489)
        at aero.timco.majic.util.Lbrfix2$1.body(Lbrfix2.java:937)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at aero.timco.majic.util.Lbrfix2.execute(Lbrfix2.java:147)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3776)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3099)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2878)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:301)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:287)
        at aero.timco.majic.util.Lbrfix1b$1.body(Lbrfix1b.java:154)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at aero.timco.majic.util.Lbrfix1b.execute(Lbrfix1b.java:74)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3776)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3099)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2878)
        at com.goldencode.p2j.util.ControlFlowOps.invokeWithMode(ControlFlowOps.java:273)
        at com.goldencode.p2j.util.ControlFlowOps.invokeWithMode(ControlFlowOps.java:255)
        at aero.timco.majic.util.Lbrfix1$1$1$11.body(Lbrfix1.java:1815)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.doBlockWorker(BlockManager.java:7716)
        at com.goldencode.p2j.util.BlockManager.doBlock(BlockManager.java:405)
        at aero.timco.majic.util.Lbrfix1$1$1.body(Lbrfix1.java:1811)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7949)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1465)
        at aero.timco.majic.util.Lbrfix1$1.body(Lbrfix1.java:379)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.util.Lbrfix1.execute(Lbrfix1.java:145)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3776)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3099)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2878)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:301)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:287)
        at aero.timco.majic.util.Lbrfix$1$1.body(Lbrfix.java:335)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7949)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1465)
        at aero.timco.majic.util.Lbrfix$1.body(Lbrfix.java:160)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.util.Lbrfix.execute(Lbrfix.java:71)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3776)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3099)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2878)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:301)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:287)
        at aero.timco.majic.menu.Call$1$2.body(Call.java:172)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7864)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:569)
        at aero.timco.majic.menu.Call$1.body(Call.java:103)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.menu.Call.execute(Call.java:34)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3776)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3099)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2878)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:301)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:287)
        at aero.timco.majic.menu.Call$1$2.body(Call.java:251)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.doLoopWorker(BlockManager.java:7864)
        at com.goldencode.p2j.util.BlockManager.doWhile(BlockManager.java:569)
        at aero.timco.majic.menu.Call$1.body(Call.java:103)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.menu.Call.execute(Call.java:34)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.ControlFlowOps$InternalEntryCaller.invoke(ControlFlowOps.java:3776)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:3099)
        at com.goldencode.p2j.util.ControlFlowOps.invokeImpl(ControlFlowOps.java:2878)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:301)
        at com.goldencode.p2j.util.ControlFlowOps.invoke(ControlFlowOps.java:287)
        at aero.timco.majic.menu.Majic$1$1.body(Majic.java:159)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.coreLoop(BlockManager.java:8055)
        at com.goldencode.p2j.util.BlockManager.repeatWorker(BlockManager.java:7949)
        at com.goldencode.p2j.util.BlockManager.repeat(BlockManager.java:1465)
        at aero.timco.majic.menu.Majic$1.body(Majic.java:59)
        at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6917)
        at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6824)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:210)
        at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:192)
        at aero.timco.majic.menu.Majic.execute(Majic.java:29)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.Utils.invoke(Utils.java:1153)
        at com.goldencode.p2j.main.StandardServer$MainInvoker.execute(StandardServer.java:1513)
        at com.goldencode.p2j.main.StandardServer.invoke(StandardServer.java:1019)
        at com.goldencode.p2j.main.StandardServer.standardEntry(StandardServer.java:320)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.goldencode.p2j.util.MethodInvoker.invoke(MethodInvoker.java:76)
        at com.goldencode.p2j.net.Dispatcher.processInbound(Dispatcher.java:675)
        at com.goldencode.p2j.net.Conversation.block(Conversation.java:316)
        at com.goldencode.p2j.net.Conversation.run(Conversation.java:158)
        at java.lang.Thread.run(Thread.java:662)

#90 Updated by Stanislav Lomany about 11 years ago

Issue 0:
The first issue to fix, the log full of it:

02:52:46,501  WARN [SqlExceptionHelper]:143 - SQL Error: 0, SQLState: XX000
02:52:46,514 ERROR [SqlExceptionHelper]:144 - ERROR: java.lang.NoClassDefFoundError: com/goldencode/p2j/net/SilentUnwindException

#91 Updated by Eric Faulhaber about 11 years ago

Stanislav Lomany wrote:

 ... com/goldencode/p2j/net/SilentUnwindException 

I guess this is a reference from within p2jpl.jar, but I don't know why it would be looking for this class for any of the PL/Java functions we use.

#92 Updated by Stanislav Lomany about 11 years ago

Eric, "java.lang.NoClassDefFoundError: com/goldencode/p2j/net/SilentUnwindException" error occurs only on lightning server. I have two local Postgresql servers (8.2 and 8.4) and they work fine. Any ideas what can be wrong/incompatible on lightning?
I'm not sure about other errors because they depend on the database state that so far exists only on lighting, but I'm working on that.

#93 Updated by Eric Faulhaber about 11 years ago

When you run dangerous_db_restore.sh to prepare for a new regression harness run, it installs p2jpl.jar in the new database instance using ../../p2j/pl/install_p2j.sql.

In /mnt/san/sata/gc/staging_svl/staging/p2j/pl, this file looks like this:

select sqlj.remove_jar('p2j', true);
select sqlj.install_jar('file:///gc/convert/pending/p2j/build/lib/p2jpl.jar', 'p2j', true);
select sqlj.set_classpath('public', 'p2j');

Note that the jar file is coming from the pending directory, which is not the one from the P2J version you are regression testing. Unfortunately, the sqlj.install_jar function requires an absolute path AFAIR, so update it accordingly. I'm not sure that is the only issue, but see if it helps.

#94 Updated by Stanislav Lomany about 11 years ago

I've reinstalled jar for the database on lightning I'm using - no result.

#95 Updated by Stanislav Lomany about 11 years ago

Sorry, as the result the message changed to

ERROR: java.lang.NoClassDefFoundError: com/goldencode/p2j/classloader/MultiClassLoader

#96 Updated by Stanislav Lomany about 11 years ago

OK, I've added all P2J classes into p2jpl.jar. It seems that the problem has disappeared.

#97 Updated by Eric Faulhaber about 11 years ago

Stanislav Lomany wrote:

OK, I've added all P2J classes into p2jpl.jar. It seems that the problem has disappeared.

Hm...I'm not crazy about this as a solution. It's a bit heavyweight, especially since you are only seeing this on lightning. What is different between lightning and your other test environment (JVM version, PG version, etc.)?

#98 Updated by Stanislav Lomany about 11 years ago

Hm...I'm not crazy about this as a solution.

I agree, I just needed to run regression testing ASAP.

I have PostgreSQL 8.2.4 and Java 1.6.0_27
Lightning - PostgreSQL 8.2.5 and Java 1.6.0_4

I cannot determine PLJava version, but I guess it is 1.4.X in both cases.

After I handle other regressions I can try to pin down what specific case causes NoClassDefFoundError.

#99 Updated by Eric Faulhaber about 11 years ago

Are all the Hibernate-related jars whose names have the word SNAPSHOT in them the most recent, stable releases? Usually "snapshot" would suggest a development or nightly build.

#100 Updated by Stanislav Lomany about 11 years ago

I checked this version out of git. I don't know why version in build.gradle is called "4.1.9-SNAPSHOT", but the code level is "4.1.8.Final" (I downloaded hibernate-release-4.1.8.Final.zip and made a comparison).

#101 Updated by Eric Faulhaber about 11 years ago

The name discrepancy is confusing. Did you do a source or binary comparison?

Let's use the standard, final, binary release (or rename the versions you built if they're binary-identical). That way, there will be no name discrepancy and customers will have no confusion.

#102 Updated by Eric Faulhaber about 11 years ago

Did you do an import (e.g., p2j_test database) to test the ImportWorker changes?

#103 Updated by Stanislav Lomany about 11 years ago

The name discrepancy is confusing. Did you do a source or binary comparison?

Let's use the standard, final, binary release (or rename the versions you built if they're binary-identical). That way, there will be no name discrepancy and customers will have no confusion.

I did source comparison because I applied the patch for Hibernate and built it from sources. I'll send the patch later.
OK, I'll rename version.

Did you do an import (e.g., p2j_test database) to test the ImportWorker changes?

Not yet, I'll tell you about the results.

#104 Updated by Eric Faulhaber about 11 years ago

Stanislav Lomany wrote:

I did source comparison because I applied the patch for Hibernate and built it from sources.

Oh, of course.

#105 Updated by Eric Faulhaber about 11 years ago

Code review 20130410a:

Wow! Quite a bit of change. Looks good overall; some comments/questions below:

  • Please add the new wrapper types to the TYPES map in DBUtils. This is not strictly related to this task, but we missed it when adding the new data types.
  • Instead of adding implementations of getBaseValue, instantiateRegular, and instantiateUnknown to the various *UserType classes, I think you should have updated those subclasses' overridden implementations of AbstractWrapperType.nullSafeGet to match Hibernate's new signature for this API.
  • The ORMHandler (and corresponding DatabaseManager) changes are a performance concern. XML processing is slow and originally was intended to only be done once at server startup. But let's go with it for now and profile later to see if it is actually a bottleneck.
  • Please clean up the non-standard formatting in the new methods in UnpooledConnectionProvider.
  • The inline comment in DatabaseManager.deregisterDatabase(Database) above your changes no longer accurately reflects what we are doing during transient database cleanup.
  • Please remove the "-T-" column from the TableMapping.java file header.
  • Why did you remove TempTableConnectionProvider.close() method? Was this removed from the ConnectionProvider interface? BTW, why is java.lang.InstantiationException imported? Is there a conflicting Hibernate version of this class?
  • You added the public method Persistence.getSession(), which will create a new Hibernate session if one is not already associated with the context. Is this a side effect you intended? This only seems to be called from your change to DynamicJoin.getParameterTypes.

#106 Updated by Eric Faulhaber about 11 years ago

  • Estimated time changed from 80.00 to 575.00
  • % Done changed from 0 to 80

#107 Updated by Stanislav Lomany about 11 years ago

  • The ORMHandler (and corresponding DatabaseManager) changes are a performance concern. XML processing is slow and originally was intended to only be done once at server startup. But let's go with it for now and profile later to see if it is actually a bottleneck.

Performance is described in note 80 above.

  • Why did you remove TempTableConnectionProvider.close() method? Was this removed from the ConnectionProvider interface?

Yes.

BTW, why is java.lang.InstantiationException imported? Is there a conflicting Hibernate version of this class?

Yes.

  • You added the public method Persistence.getSession(), which will create a new Hibernate session if one is not already associated with the context. Is this a side effect you intended? This only seems to be called from your change to DynamicJoin.getParameterTypes.

Yes. All these changes are about finding a replacement for Hibernate.entity function.

#108 Updated by Eric Faulhaber about 11 years ago

Stanislav Lomany wrote:

  • Instead of adding implementations of getBaseValue, instantiateRegular, and instantiateUnknown to the various *UserType classes, I think you should have updated those subclasses' overridden implementations of AbstractWrapperType.nullSafeGet to match Hibernate's new signature for this API.

Can you please elaborate?

You changed AbstractWrapperUserType.nullSafeGet, presumably because the signature of this API changed in Hibernate's UserType interface (addition of SessionImplementor session as the third parameter). The getBaseValue, instantiateRegular, and instantiateUnknown methods are only called from this method implementation in the parent class. They are not needed in the subclasses which override it. From the JavaDoc in AbstractWrapperUserType.nullSafeGet:

Note: this method assumes a mapping of JDBC data type to a Java object. Subclasses which deal in primitives must override this implementation to avoid attempting to extract an object reference from the result set.

So, we need to make the same signature change to the versions of nullSafeGet in the subclasses of AbstractWrapperUserType which override it. Right now, those subclasses are using the old nullSafeGet signature, so they will never be called.

#109 Updated by Stanislav Lomany about 11 years ago

Thank you for so quick reply! I just got it, but you wrote your reply before I updated my comment.

#110 Updated by Stanislav Lomany about 11 years ago

I've update the code according to the note 105 and successfully ran regression testing. So in order to complete this task I have to:
1. Solve the problem with p2jpl. It confuses me a bit that I don't know why it wants to load these extra classes. I can try to figure it out, but it seems more practical to me just add in turn all of the classes it wants.
2. Test ImportWorker.
3. Send update for Hibernate code.

#111 Updated by Stanislav Lomany about 11 years ago

Eric, by default Hibernate logs DEBUG information, so I've added cfg/log4j.properties which sets the root log4j logging level to INFO. In order to use this configuration file -Dlog4j.configuration=file:../../cfg/log4j.properties option should be specified. Should I add this option to server.sh in timco repository?

Also, a change in *-directory.xml files is required. Should I update these files in the repository?

#112 Updated by Constantin Asofiei about 11 years ago

Stanislav: if you have changes to MAJIC files (like directories or scripts), note we are moving away from the TIMCO CVS repository; also, I'm pretty close of completing this, so please wait until then to commit these changes, as I have changes to the directories and server.sh scripts (you will need to commit it to a staging branch in the TIMCO GIT repository).

#113 Updated by Eric Faulhaber about 11 years ago

Is there any way you can see to get Hibernate to honor the logging configuration we set in the P2J directory; i.e., some sort of programmatic way to set the root logging level? Has the Hibernate upgrade broken the use of all the logging settings in the directory?

#114 Updated by Stanislav Lomany about 11 years ago

Eric, the logging problems take place when customer_libs/log4j*.jar is in classpath: Hibernate 4 uses Jboss-logging and it prefers log4j over Java logging. The following option can be used to avoid this problem: -Dorg.jboss.logging.provider=jdk, but still the message

log4j:WARN No appenders could be found for logger (SOME_CLASS_NAME_HERE).
log4j:WARN Please initialize the log4j system properly.

appears.

#115 Updated by Stanislav Lomany about 11 years ago

This makes Java logging preferable over log4j:

-Dorg.jboss.logging.provider=jdk -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger -Dcom.mchange.v2.log.MLog=com.mchange.v2.log.jdk14logging.Jdk14MLog

#116 Updated by Stanislav Lomany about 11 years ago

The problem with p2jpl.jar is not reproducible at this point. Maybe database state is wrong, maybe something else. I'll re-run regression testing this night to be sure.

#118 Updated by Stanislav Lomany about 11 years ago

Eric, I need to add mapping for datetime and datetimetz to DataTypeHelper.classes. What HQL type(s) (see HQLTypes) should correspond these datetime types? I suggest to add the new type HQLTypes.TIMESTAMP for both of them.

#119 Updated by Eric Faulhaber about 11 years ago

Stanislav Lomany wrote:

Eric, I need to add mapping for datetime and datetimetz to DataTypeHelper.classes. What HQL type(s) (see HQLTypes) should correspond these datetime types? I suggest to add the new type HQLTypes.TIMESTAMP for both of them.

Ovidiu: have you already worked on this for #1584?

#120 Updated by Ovidiu Maxiniuc about 11 years ago

No, not yet, and probably will not work on datetime/tz and persistence this week.

Please add the two constants, for both datetime and datetimetz, I will merge with your changes later.

I don't know how Hibernate handles this, but special care should be taken with datetimetz as it is a compound type (datetime and timezone).

#121 Updated by Eric Faulhaber about 11 years ago

Stanislav Lomany wrote:

I suggest to add the new type HQLTypes.TIMESTAMP for both of them.

IIRC, the HQLTypes enumeration is just there for HQLPreprocessor's benefit, used when preprocessing where clauses. I think we have to differentiate between the date, datetime and datetimetz types, so that builtin functions which use them are categorized correctly, and in the event we have to treat these types of query substitution parameters specially. Please use HQLTypes.DATETIME and HQLTypes.DATETIMETZ for the new ones.

#122 Updated by Stanislav Lomany about 11 years ago

Eric, am I correct that should add HQLTypes.DATETIME and HQLTypes.DATETIMETZ, but shouldn't worry about handling these cases in HQLPreprocessor?

#123 Updated by Eric Faulhaber about 11 years ago

Stanislav Lomany wrote:

Eric, am I correct that should add HQLTypes.DATETIME and HQLTypes.DATETIMETZ,

Yes.

...but shouldn't worry about handling these cases in HQLPreprocessor?

Not sure. Look for places where we handle all HQLTypes, like switch statements, and see if the new types need to be accounted for there. For example, I think you'll need to edit HQLPreprocessor.getDatatypeSubstitutionForCastFunction to avoid throwing IllegalArgumentException.

#124 Updated by Stanislav Lomany about 11 years ago

For HQLPreprocessor.inlineSubstitutionParameter we need a formatting function for these types, like P2JDialect.formatDate. Since I can't quickly handle it, I can leave it as is - these new types just will not be inlined.
About HQLPreprocessor.getDatatypeSubstitutionForCastFunction: what is the corresponding CAST type - timestamp?

#125 Updated by Eric Faulhaber about 11 years ago

I assume it is timestamp for datetime, but datetimetz is a compound type mapped to 2 types: timestamp and smallint. I'm not sure how this would work with the cast workaround for the H2 bug you described in HQLPreprocessor.tryExplicitCastInTernary. Map it to timestamp for now, but put in a TODO.

#126 Updated by Eric Faulhaber about 11 years ago

  • Due date set to 04/29/2013

#127 Updated by Stanislav Lomany about 11 years ago

About testing changes in ImportWorker: how can I start import? I supposed it is performed thru ConversionDriver.

About p2jpl: the bug is still there, I'm working on it.

#128 Updated by Eric Faulhaber about 11 years ago

Stanislav Lomany wrote:

About testing changes in ImportWorker: how can I start import? I supposed it is performed thru ConversionDriver.

See import.sh in staging. It should be sufficient to test with the p2j_test database.

About p2jpl: the bug is still there, I'm working on it.

I have you scheduled to finish this task by Monday. Do you think that's sufficient?

#129 Updated by Stanislav Lomany about 11 years ago

Yes, that is definitely sufficient. I'll add missing classes (although I'm still interested what is exactly wrong with this thing).

#130 Updated by Stanislav Lomany about 11 years ago

Fixed minor issue with importing.

Met another error:

Caused by: java.lang.NoSuchMethodException: com.goldencode.testcases.dmo.p2j_test.impl.AddressImpl.setStreet(com.goldencode.p2j.util.character)
        at java.lang.Class.getMethod(Class.java:1605)
        at com.goldencode.p2j.schema.PropertyMapper.<init>(PropertyMapper.java:124)
        at com.goldencode.p2j.schema.PropertyMapper$CharacterMapper.<init>(PropertyMapper.java:449)
        ... 22 more

The problem is that setStreet takes Text, not character. I suggest to make this change in PropertyMapper.CharacterMapper:
Class getPropertyClass()
{
   return Text.class;   //was character.class
}

#131 Updated by Stanislav Lomany about 11 years ago

There is

org.hibernate.TransactionException: nested transactions not supported

on index creation during import process, working on it. Data import works fine.

#132 Updated by Stanislav Lomany almost 11 years ago

I fixed importing problems.

While working on p2jpl I came to the point where MAJIC throws this NPE no matter what classes are contained in the p2jpl.jar:

org.postgresql.util.PSQLException: ERROR: java.lang.NullPointerException
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:193)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:351)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:255)
    at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
    at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:122)
    at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81)
    at $Proxy5.executeQuery(Unknown Source)
    at org.hibernate.loader.Loader.getResultSet(Loader.java:1926)
    at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1727)
    at org.hibernate.loader.Loader.doQuery(Loader.java:852)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:293)
    at org.hibernate.loader.Loader.doList(Loader.java:2411)
    at org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2256)
    at org.hibernate.loader.Loader.list(Loader.java:2219)
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:470)
    at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:355)
    at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:195)
    at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1247)
    at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
    at org.hibernate.internal.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:905)
    at com.goldencode.p2j.persist.Persistence.load(Persistence.java:1680)

The good news is that today I found that it seems that locally built p2jpl.jar doesn't suffer from "class not found" and other exceptions (including the one above). I'm figuring out what are the differences between p2jpl.jar files.

#133 Updated by Constantin Asofiei almost 11 years ago

Stanislav, just a thought: make sure the right p2jpl.jar version is installed in the and DB and the install_p2jpl.sql scripts points to the correct p2jpl.jar file.

#134 Updated by Stanislav Lomany almost 11 years ago

Missing class problems were about outdated p2jpl.ddr in my test directory on lightning (missing change was "Renamed julianDayInt() to toInt() and julianDayDec() to toDec(). The signature is unique enough to use the same overloaded method name").

#135 Updated by Stanislav Lomany almost 11 years ago

The final Hibernate update (P2J part). Passed regression testing (with postgresql-8*.jar). You may want review it.

#137 Updated by Eric Faulhaber almost 11 years ago

Code review 20130501a:

  • In the ImportWorker.QueryHelper c'tor, the TYPES map initialization should include the new data types. At the moment, we don't use this functionality, but since this change should be minimal effort, I'd like to keep the code up to date with the data type additions.
  • DBUtils: Vadim's latest update, which was just checked in, needs to be merged.
  • DBUtils: I'm a bit confused by the call to manyToOne in makeTypeArray; what's that about?
  • RecordBuffer: Vadim's latest update, which was just checked in, needs to be merged. He has a lot more change than you, so it would be easiest to just merge your changes into his version.
  • I didn't find where you dealt with the "positional parameter are considered deprecated" warnings. Can you point me to that?

With the minor changes noted above, I think this code can be checked in. We'll regression test again when devsrv01 is ready. I'd like to get this committed before you leave for vacation, even if the positional parameters have not been dealt with yet (I assume the warnings are just log noise at this point, and do not interfere with operation -- correct me if I'm wrong).

#138 Updated by Stanislav Lomany almost 11 years ago

Position parameters are not handled yet, I though it has lower priority than other tasks. Yes they are just log noise. But because of vacation it may be reasonable to make final push with it now rather than making slow start with #2122.

#139 Updated by Stanislav Lomany almost 11 years ago

  • In the ImportWorker.QueryHelper c'tor, the TYPES map initialization should include the new data types. At the moment, we don't use this functionality, but since this change should be minimal effort, I'd like to keep the code up to date with the data type additions.

I've added int64 and datetime(tz). Please point what other new types have to do with persistence.

  • DBUtils: I'm a bit confused by the call to manyToOne in makeTypeArray; what's that about?

It is about replacing Hibernate.entity. In Hibernate 3 code it looked tike this:

public static Type entity(Class persistentClass) {
   // not really a many-to-one association *necessarily*
   return new ManyToOneType( persistentClass.getName() );
}

#140 Updated by Eric Faulhaber almost 11 years ago

  • Due date changed from 04/29/2013 to 05/03/2013

OK, please make the minor merges and check in what you've got.

Please push through the positional parameters issue as soon as possible. It would be great if you could finish this before you leave. BTW, I think this has to be done in HQLPreprocessor, because in some cases a single placeholder is expanded to multiple placeholders by this class.

Please update your hours before you leave.

#141 Updated by Stanislav Lomany almost 11 years ago

Eric, there are two options to solve positional parameters:
1. Number parameters in HQLPreprocessor and other places that append substitution parameters. The problem is that multiplex id and some other parameters are appended outside HQLPreprocessor (search for "=?" and "= ?"). So we must ensure that sequential numbering is correct across multiple classes.
2. Number parameters at the very end in places like in Persistence.getQuery. The problem is that we have to parse the query.

So, IMO the first solution has better performance and the second is cleaner and safer. Which one to prefer?

#142 Updated by Eric Faulhaber almost 11 years ago

I prefer the first solution. I don't want to have yet another query parser at runtime.

#145 Updated by Stanislav Lomany almost 11 years ago

In what form should I provide changes to the configuration directory file? Should I make a patching script and/or patch all various directory.xml* files in git? The change is about c3p0 configuration:

<node class="container" name="region">
   <node class="string" name="factory_class">
      <node-attribute name="value" value="org.hibernate.cache.ehcache.EhCacheRegionFactory"/>
   </node>
</node>

#146 Updated by Constantin Asofiei almost 11 years ago

In what form should I provide changes to the configuration directory file? Should I make a patching script and/or patch all various directory.xml* files in git?

A patching script would be nice, as at some point we will release this to TIMCO, and they will have to patch their production/testing directories too.

#147 Updated by Stanislav Lomany almost 11 years ago

  • File svl_upd20130502c.zip added

Patch for MAJIC. Be aware that I have not tested QaVendorUtils.

#148 Updated by Stanislav Lomany almost 11 years ago

  • File deleted (svl_upd20130502c.zip)

#149 Updated by Stanislav Lomany almost 11 years ago

  • File deleted (svl_test20130410b.zip)

#150 Updated by Eric Faulhaber almost 11 years ago

  • Status changed from WIP to Review

I get the following warnings when compiling with this update. I have updated the code from bzr, rather than manually applying the updates. Is this expected? Either way, they need to be cleaned up.

    [javac] Compiling 1113 source files to /home/ecf/projects/p2j_test/build/classes
    [javac] /home/ecf/projects/p2j_test/src/com/goldencode/p2j/persist/dialect/P2JPostgreSQLDialect.java:113: warning: [deprecation] PostgreSQLDialect in org.hibernate.dialect has been deprecated
    [javac] extends PostgreSQLDialect
    [javac]         ^
    [javac] /home/ecf/projects/p2j_test/src/com/goldencode/p2j/persist/Persistence.java:1386: warning: [deprecation] NEVER in FlushMode has been deprecated
    [javac]             query.setFlushMode(FlushMode.NEVER);
    [javac]                                         ^
    [javac] /home/ecf/projects/p2j_test/src/com/goldencode/p2j/persist/Persistence.java:1517: warning: [deprecation] NEVER in FlushMode has been deprecated
    [javac]             query.setFlushMode(FlushMode.NEVER);
    [javac]                                         ^
    [javac] /home/ecf/projects/p2j_test/src/com/goldencode/p2j/persist/Persistence.java:1673: warning: [deprecation] NEVER in FlushMode has been deprecated
    [javac]             query.setFlushMode(FlushMode.NEVER);
    [javac]                                         ^
    [javac] /home/ecf/projects/p2j_test/src/com/goldencode/p2j/persist/Persistence.java:2776: warning: [deprecation] lock(Object,LockMode) in Session has been deprecated
    [javac]             session.lock(object, LockMode.NONE);
    [javac]                    ^
    [javac] /home/ecf/projects/p2j_test/src/com/goldencode/p2j/persist/Persistence.java:4032: warning: [deprecation] NEVER in FlushMode has been deprecated
    [javac]                session.setFlushMode(FlushMode.NEVER);
    [javac]                                              ^
    [javac] /home/ecf/projects/p2j_test/src/com/goldencode/p2j/persist/Persistence.java:4190: warning: [deprecation] NEVER in FlushMode has been deprecated
    [javac]             session.setFlushMode(explicit ? FlushMode.AUTO : FlushMode.NEVER);
    [javac]                                                                       ^
    [javac] /home/ecf/projects/p2j_test/src/com/goldencode/p2j/persist/Persistence.java:4517: warning: [deprecation] lock(Object,LockMode) in Session has been deprecated
    [javac]                   session.lock(record, LockMode.NONE);
    [javac]                          ^
    [javac] /home/ecf/projects/p2j_test/src/com/goldencode/p2j/persist/RecordBuffer.java:8467: warning: [deprecation] lock(Object,LockMode) in Session has been deprecated
    [javac]                   session.lock(currentRecord, LockMode.NONE);
    [javac]                          ^
    [javac] /home/ecf/projects/p2j_test/src/com/goldencode/p2j/persist/TempTableHelper.java:1087: warning: [deprecation] getIdentifierGeneratorFactory() in Mapping has been deprecated
    [javac]       public IdentifierGeneratorFactory getIdentifierGeneratorFactory()
    [javac]                                         ^
    [javac] /home/ecf/projects/p2j_test/src/com/goldencode/p2j/persist/dialect/P2JH2Dialect.java:801: warning: [deprecation] getIdentifierGeneratorFactory() in Mapping has been deprecated
    [javac]                public IdentifierGeneratorFactory getIdentifierGeneratorFactory()
    [javac]                                                  ^
    [javac] /home/ecf/projects/p2j_test/src/com/goldencode/p2j/persist/dialect/P2JPostgreSQLDialect.java:875: warning: [deprecation] getLimitString(String,int,int) in Dialect has been deprecated
    [javac]    public String getLimitString(String sql, int offset, int limit)
    [javac]                  ^
    [javac] /home/ecf/projects/p2j_test/src/com/goldencode/p2j/persist/dialect/P2JPostgreSQLDialect.java:894: warning: [deprecation] getLimitString(String,int,int) in Dialect has been deprecated
    [javac]          stmt = super.getLimitString(sql, offset, limit);
    [javac]                      ^
    [javac] /home/ecf/projects/p2j_test/src/com/goldencode/p2j/persist/dialect/P2JPostgreSQLDialect.java:911: warning: [deprecation] supportsVariableLimit() in Dialect has been deprecated
    [javac]    public boolean supportsVariableLimit()
    [javac]                   ^
    [javac] /home/ecf/projects/p2j_test/src/com/goldencode/p2j/persist/dialect/P2JPostgreSQLDialect.java:913: warning: [deprecation] supportsVariableLimit() in Dialect has been deprecated
    [javac]       return (inlineLimit.get() ? false : super.supportsVariableLimit());
    [javac]                                                ^
    [javac] /home/ecf/projects/p2j_test/src/com/goldencode/p2j/schema/ImportWorker.java:352: warning: [deprecation] NEVER in FlushMode has been deprecated
    [javac]       session.setFlushMode(FlushMode.NEVER);
    [javac]                                     ^
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 16 warnings

#151 Updated by Eric Faulhaber almost 11 years ago

Stas: you must have a full version of the modified 4.1.8Final Hibernate source code on your system, from which you built the updated hibernate.jar. Please zip this up and put it on filesrv01 (~/shared/projects/hibernate), so others on the team can use it for debugging Hibernate. Vadim is having problems with mismatched source in the debugger.

#152 Updated by Stanislav Lomany almost 11 years ago

OK, I did it.

#153 Updated by Vadim Nebogatov almost 11 years ago

I did not find sources. shared/projects does not contain hibernate subfoder...
I see only old shared/projects/p2j/hibernate-3.0.5.zip

#154 Updated by Stanislav Lomany over 10 years ago

I've uploaded original Hibernate sources to shared/projects/p2j/hibernate/hibernate-4.1.8.Final-original.zip and the added attached patch file to p2j/lib replacing the old patch files.

#155 Updated by Eric Faulhaber over 10 years ago

  • Status changed from Review to Closed
  • % Done changed from 80 to 100

#156 Updated by Stanislav Lomany almost 10 years ago

This is how to build Hibernate from sources:

unzip hibernate-orm-4.1.8.Final_patch.zip -d patch
git clone git://github.com/hibernate/hibernate-orm.git
cd hibernate-orm
git checkout 4.1.8.Final
patch hibernate-core/src/main/antlr/hql-sql.g ../patch/hibernate-core/src/main/antlr/hql-sql.20130424a.patch
patch hibernate-core/src/main/antlr/sql-gen.g ../patch/hibernate-core/src/main/antlr/sql-gen.20141212a.patch (supercedes sql-gen.20130424a.patch)
patch hibernate-core/src/main/java/org/hibernate/cfg/Configuration.java ../patch/hibernate-core/src/main/java/org/hibernate/cfg/Configuration.20130924a.patch
patch hibernate-core/src/main/java/org/hibernate/hql/internal/ast/SqlGenerator.java ../patch/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/SqlGenerator.20130709a.patch
patch hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java ../patch/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.20130924a.patch
cp ../patch/hibernate-core/src/main/java/org/hibernate/internal/MutableSessionFactoryImpl.java hibernate-core/src/main/java/org/hibernate/internal/
./gradlew jar
cp hibernate-core/target/libs/hibernate-core-4.1.8.Final.jar ../hibernate-core-4.1.8.jar
cp hibernate-ehcache/target/libs/hibernate-ehcache-4.1.8.Final.jar ../hibernate-ehcache-4.1.8.jar
cp hibernate-c3p0/target/libs/hibernate-c3p0-4.1.8.Final.jar ../hibernate-c3p0-4.1.8.jar

resulting files are:

hibernate-core-4.1.8.jar
hibernate-ehcache-4.1.8.jar
hibernate-c3p0-4.1.8.jar

#157 Updated by Greg Shah over 7 years ago

  • Target version changed from Milestone 7 to Runtime Support for Server Features

#158 Updated by Stanislav Lomany about 7 years ago

Guys, we have removed lib/hibernate-orm-4.1.8.Final_patch.zip from P2J project. Where is it stored now?

#159 Updated by Greg Shah about 7 years ago

I was planning for them to be downloadable from one of our wiki pages (like FWD v3.0.0).

Please add them to that page or create a new page for the patch downloads.

#160 Updated by Stanislav Lomany about 7 years ago

I would like to create a new page for "External Project Patches", but I don't know how to do it. Maybe I just don't have permissions.

#161 Updated by Greg Shah about 7 years ago

All you need to do is to edit the parent document and add [[My New Page Name]] as a link. Save it.

Then you will see the new link in red. Click on it. Add some content and save it. The document is now there. Make sure you do this from the right parent document so that the page exists in the right project's wiki.

Also available in: Atom PDF