Skip to content

Instantly share code, notes, and snippets.

@scottmarlow
scottmarlow / gist:8935291
Created Feb 11, 2014
BeforeCompletion warning IllegalStateException: IJ000152: Trying to return an unknown connection:
View gist:8935291
14:56:08,882 INFO [org.jboss.jca.core.connectionmanager.listener.TxConnectionListener] (default task-14) IJ000311: Throwable from unregister connection: java.lang.IllegalStateException: IJ000152: Trying to return an unknown connection: org.jboss.jca.adapters.jdbc.jdk7.WrappedConnectionJDK7@1f8109e
at org.jboss.jca.core.connectionmanager.ccm.CachedConnectionManagerImpl.unregisterConnection(CachedConnectionManagerImpl.java:385)
at org.jboss.jca.core.connectionmanager.listener.TxConnectionListener.connectionClosed(TxConnectionListener.java:587)
at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.closeHandle(BaseWrapperManagedConnection.java:581)
at org.jboss.jca.adapters.jdbc.WrappedConnection.close(WrappedConnection.java:265)
at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.closeConnection(DatasourceConnectionProviderImpl.java:144) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.releaseC
@scottmarlow
scottmarlow / gist:8935365
Created Feb 11, 2014
directly from hibernate application call (JTA transaction and commit not called yet) IllegalStateException: IJ000152: Trying to return an unknown connection
View gist:8935365
2014-02-10 19:00:39,945 INFO [org.jboss.jca.core.connectionmanager.listener.TxConnectionListener] (default task-11) IJ000311: Throwable from unregister connection: java.lang.IllegalStateException: IJ000152: Trying to return an unknown connection: org.jboss.jca.adapters.jdbc.jdk7.WrappedConnectionJDK7@419f84f4
at org.jboss.jca.core.connectionmanager.ccm.CachedConnectionManagerImpl.unregisterConnection(CachedConnectionManagerImpl.java:385)
at org.jboss.jca.core.connectionmanager.listener.TxConnectionListener.connectionClosed(TxConnectionListener.java:587)
at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.closeHandle(BaseWrapperManagedConnection.java:581)
at org.jboss.jca.adapters.jdbc.WrappedConnection.close(WrappedConnection.java:265)
at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.closeConnection(DatasourceConnectionProviderImpl.java:144) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAcc
@scottmarlow
scottmarlow / gist:8956979
Created Feb 12, 2014
Hibernate possibly leaking a Statement
View gist:8956979
2014-02-11 10:10:21,836 DEBUG [org.hibernate.engine.internal.TwoPhaseLoad] (default task-4) Done materializing entity [com.at.hib.persistence.CommissionGroup#3]
2014-02-11 10:10:21,836 DEBUG [org.hibernate.loader.entity.plan.AbstractLoadPlanBasedEntityLoader] (default task-4) Done entity load : com.at.hib.persistence.CommissionGroup#3
2014-02-11 10:10:21,837 DEBUG [org.hibernate.engine.internal.TwoPhaseLoad] (default task-4) Adding entity to second-level cache: [com.at.hib.persistence.Employee#192]
2014-02-11 10:10:21,838 TRACE [com.arjuna.ats.jta] (default task-4) TransactionImple.getStatus: javax.transaction.Status.STATUS_ACTIVE
2014-02-11 10:10:21,838 TRACE [com.arjuna.ats.jta] (default task-4) TransactionSynchronizationRegistryImple.registerInterposedSynchronization
2014-02-11 10:10:21,838 TRACE [com.arjuna.ats.jta] (default task-4) TransactionImple.getStatus: javax.transaction.Status.STATUS_ACTIVE
2014-02-11 10:10:21,838 TRACE [com.arjuna.ats.jta] (default task-4) TransactionImple.equals
2014-02-11 10:10
View gist:9919741
apply plugin: 'java'
repositories {
mavenCentral()
mavenLocal()
maven {
name 'jboss-nexus'
url "http://repository.jboss.org/nexus/content/groups/public/"
}
@scottmarlow
scottmarlow / tckfindbadargs.sh
Created Apr 2, 2014
git bisect script for finding commit that caused regression
View tckfindbadargs.sh
#!/bin/sh
echo "build the application server"
./build.sh clean install -Dmaven.test.skip=true || exit 125
echo "run the tck test now"
export TS_HOME=/home/smarlow/work/tck7/trunk
export JBOSS_HOME=/home/smarlow/work/as8/build/target/wildfly-8.0.1.Final-SNAPSHOT
export JAVAEE_HOME=$JBOSS_HOME
export JAVAEE_HOME_RI=/home/smarlow/work/glassfish4
@scottmarlow
scottmarlow / gist:30a83514b4d0e0fde901
Created Jun 26, 2014
com.fasterxml.classmate.ResolvedType._getMethods Permission check failed for ("java.lang.RuntimePermission" "accessDeclaredMembers")
View gist:30a83514b4d0e0fde901
Caused by: java.security.AccessControlException: WFSM000001: Permission check failed for ("java.lang.RuntimePermission" "accessDeclaredMembers")
at org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:241)
at org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:150)
at java.lang.SecurityManager.checkMemberAccess(SecurityManager.java:1675) [rt.jar:1.7.0_60]
at org.wildfly.security.manager.WildFlySecurityManager.checkMemberAccess(WildFlySecurityManager.java:395)
at java.lang.Class.checkMemberAccess(Class.java:2282) [rt.jar:1.7.0_60]
at java.lang.Class.getDeclaredMethods(Class.java:1854) [rt.jar:1.7.0_60]
at com.fasterxml.classmate.ResolvedType._getMethods(ResolvedType.java:371)
at com.fasterxml.classmate.types.ResolvedObjectType.getMemberMethods(ResolvedObjectType.java:151)
at com.fasterxml.classmate.ResolvedTypeWithMembers.resolveMemberMethods(ResolvedTyp
View gist:711023119156fe9e5ead
/**
* Substitute sub-strings in side of a string.
*
* @param stringBuilder String buffer to use for substitution (buffer is not reset)
* @param from String to substitute from
* @param to String to substitute to
*/
private static void subst(final StringBuilder stringBuilder, final String from, final String to) {
int begin = 0, end = 0;
View gist:5ae00fe0af4ae45e0876
/**
* Substitute sub-strings in side of a string.
*
* @param buff Stirng buffer to use for substitution (buffer is not reset)
* @param from String to substitute from
* @param to String to substitute to
* @param string String to look for from in
* @return Substituted string
*/
public static String subst(final StringBuffer buff, final String from, final String to, final String string)
@scottmarlow
scottmarlow / StringReplace.java
Created Jul 8, 2014
used for search/replace within a string.
View StringReplace.java
package org.jboss.as.jpa.hibernate4.management;
/**
* StringReplace
*
* @author Scott Marlow
*/
public final class StringReplace {
private final String find;
@scottmarlow
scottmarlow / QueryName.java
Created Jul 8, 2014
test main for QueryName class for testing perf
View QueryName.java
public static void main(String[] args) {
String test = "select * from employee e (where e.id <> 0 and e.name ='foo' and e.other != 'other'";
long start = System.currentTimeMillis();
for ( int looper = 0; looper < 500000; looper ++) {
QueryName name = new QueryName(test);
}
long end = System.currentTimeMillis();
System.out.println("took " + (end- start) + "ms, input= " + test + ", displayable =" + new QueryName(test).getDisplayName());