Skip to content

Instantly share code, notes, and snippets.

@gbadner
gbadner / gist:8007065
Created December 17, 2013 15:50
:hibernate-core:runAnnotationProcessors failure
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':hibernate-core:runAnnotationProcessors'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.int
@gbadner
gbadner / gist:7837050
Created December 7, 2013 03:46
Jta and Jdbc design for JdbcSession Proposal
interface JdbcSession {
TransactionCoordinator getTransactionCoordinator();
Object accept(PreparedStatementQueryOperation operation);
// renamed to execute()?
void closeResources(PreparedStatementQueryOperation operation);
// needed???
}
@gbadner
gbadner / gist:7681508
Created November 27, 2013 19:19
AliasResolutionContext.getSourceAlias()
/**
* Resolve the source alias (select-clause assigned alias) associated with the specified Return. The source
* alias is the alias associated with the Return in the source query.
* <p/>
* The concept of a source alias only has meaning in the case of queries (HQL, Criteria, etc). Not sure we
* really need to keep these here. One argument for keeping them is that I always thought it would be nice to
* base the SQL aliases on the source aliases. Keeping the source aliases here would allow us to do that as
* we are generating those SQL aliases internally.
* <p/>
* Should also consider pushing the source "from clause aliases" here if we keep pushing the select aliases
@gbadner
gbadner / gist:7665622
Created November 26, 2013 20:27
java.sql.SQLException: Cannot close a connection while a transaction is still active.
[javatest.batch] 11-26-2013 14:42:33: TRACE: EntityManagerFactory class:org.hibernate.jpa.internal.EntityManagerFactoryImpl isOpen:true
[javatest.batch] Nov 26, 2013 2:42:33 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl stop
[javatest.batch] INFO: HHH000030: Cleaning up connection pool [jdbc:derby://localhost:1527/derbyDB;user=cts1;password=cts1;create=true]
[javatest.batch] Nov 26, 2013 2:42:33 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl stop
[javatest.batch] WARN: HHH000293: Problem closing pooled connection
[javatest.batch] java.sql.SQLException: Cannot close a connection while a transaction is still active.
[javatest.batch] at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
[javatest.batch] at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
[javatest.batch] at org.apache.derby.client.am.Connection.closeResourcesX(Unknown Source)
[javatest.batch] at org.apache.derb
@gbadner
gbadner / gist:7592399
Created November 22, 2013 00:16
Failure: com/sun/ts/tests/jpa/ee/propagation/cm/extended/Client.java#test6
\u001b[0m\u001b[0m22:45:22,635 INFO [stdout] (Thread-188) ************************************************************
\u001b[0m\u001b[0m22:45:22,879 INFO [stdout] (Thread-188) 11-20-2013 22:45:22: ERROR: Unexpected Exception :
\u001b[0m\u001b[0m22:45:22,884 INFO [stdout] (Thread-188) 11-20-2013 22:45:22: ERROR: javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.HibernateException: Transaction was rolled back in a different thread!
\u001b[0m\u001b[0m22:45:22,885 INFO [stdout] (Thread-188) at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:190)
\u001b[0m\u001b[0m22:45:22,886 INFO [stdout] (Thread-188) at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275)
\u001b[0m\u001b[0m22:45:22,886 INFO [stdout] (Thread-188) at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:340)
\u001b[0m\u001b[0m22:45:22,887 INFO [stdout] (Thread-188) at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxIn
@gbadner
gbadner / gist:3177636
Created July 25, 2012 18:12 — forked from stliu/gist:3141182
hibernate metamodel branch progress

This document is supposed to be used as a tracker of the progress of hibernate metamodel branch.

We want a uniform place to track the progress, so I use this instead of JIRA.

There are 5 major works shoulb be done to complete a mapping:

  • source
  • binding
  • binder
  • persister
@gbadner
gbadner / gist:3168141
Created July 24, 2012 05:07 — forked from stliu/gist:3141182
hibernate metamodel branch progress

This document is supposed to be used as a tracker of the progress of hibernate metamodel branch.

We want a uniform place to track the progress, so I use this instead of JIRA.

There are 5 major works shoulb be done to complete a mapping:

  • source
  • binding
  • binder
  • persister
@gbadner
gbadner / gist:3100482
Created July 12, 2012 19:48
Determining if a backref is needed
Remove BackrefAttributeBinding creation from Binder.
Add the following to EntityBinding:
private Set<PluralAttributeKeyBinding> referencingPluralAttributeKeyBindings;
public void addReferencingPluralAttributeKeyBinding(PluralAttributeBinding pluralAttributeKeyBinding) {
referencingPluralAttributeKeyBindings.add( pluralAttributeKeyBinding );
}
Bind global configuration (which are done already???)
(schema, catalog, imports, filters, fetch profiles, identifier generators, typedefs, named/native queries, resultset, auxiliary database object, etc)
Schema tools need to support persistent ID generators
(sequences and other IDs requiring DB objects will not work until this is fixed)
Use case examples:
A) Inheritance (not all are jpa)
1) table per class hierarchy (done?)
2) table per subclass
@gbadner
gbadner / gist:1035881
Created June 20, 2011 16:00
ClassHolderImpl
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU