public void warning(SAXParseException warn) { LOG.trace( extractInfo( warn ) ); } }
return null; LOG.trace( "Building attribute [" + ownerType.getName() + "." + property.getName() + "]" ); final AttributeContext<X> attributeContext = wrap( ownerType, property ); final AttributeMetadata<X, Y> attributeMetadata = determineAttributeMetadata( attributeContext, normalMemberResolver );
private void managedClose() { log.trace( "Automatically closing session" ); closeWithoutOpenChecks(); }
private <X> Set<SingularPersistentAttribute<? super X, ?>> buildIdClassAttributes( IdentifiableTypeDescriptor<X> ownerType, Iterator<Property> propertyIterator) { if ( LOG.isTraceEnabled() ) { LOG.trace( "Building old-school composite identifier [" + ownerType.getJavaType().getName() + ']' ); } Set<SingularPersistentAttribute<? super X, ?>> attributes = new HashSet<>(); while ( propertyIterator.hasNext() ) { attributes.add( attributeFactory.buildIdAttribute( ownerType, propertyIterator.next() ) ); } return attributes; }
@SuppressWarnings("unused") private void writeObject(ObjectOutputStream oos) throws IOException { if ( log.isTraceEnabled() ) { log.trace( "Serializing " + getClass().getSimpleName() + " [" ); } if ( !jdbcCoordinator.isReadyForSerialization() ) { // throw a more specific (helpful) exception message when this happens from Session, // as opposed to more generic exception from jdbcCoordinator#serialize call later throw new IllegalStateException( "Cannot serialize " + getClass().getSimpleName() + " [" + getSessionIdentifier() + "] while connected" ); } if ( isTransactionCoordinatorShared ) { throw new IllegalStateException( "Cannot serialize " + getClass().getSimpleName() + " [" + getSessionIdentifier() + "] as it has a shared TransactionCoordinator" ); } // todo : (5.2) come back and review serialization plan... // this was done quickly during initial HEM consolidation into CORE and is likely not perfect :) // // be sure to review state fields in terms of transient modifiers // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Step 1 :: write non-transient state... oos.defaultWriteObject(); // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Step 2 :: write transient state... // -- see concurrent access discussion factory.serialize( oos ); oos.writeObject( jdbcSessionContext.getStatementInspector() ); jdbcCoordinator.serialize( oos ); }
@Override @SuppressWarnings("StatementWithEmptyBody") public void close() throws HibernateException { if ( isClosed() ) { if ( getFactory().getSessionFactoryOptions().getJpaCompliance().isJpaClosedComplianceEnabled() ) { throw new IllegalStateException( "Illegal call to #close() on already closed Session/EntityManager" ); } log.trace( "Already closed" ); return; } closeWithoutOpenChecks(); }
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException, SQLException { if ( log.isTraceEnabled() ) { log.trace( "Deserializing " + getClass().getSimpleName() ); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Step 1 :: read back non-transient state... ois.defaultReadObject(); sessionEventsManager = new SessionEventListenerManagerImpl(); // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Step 2 :: read back transient state... // -- see above factory = SessionFactoryImpl.deserialize( ois ); jdbcSessionContext = new JdbcSessionContextImpl( this, (StatementInspector) ois.readObject() ); jdbcCoordinator = JdbcCoordinatorImpl.deserialize( ois, this ); cacheTransactionSync = factory.getCache().getRegionFactory().createTransactionContext( this ); transactionCoordinator = factory.getServiceRegistry() .getService( TransactionCoordinatorBuilder.class ) .buildTransactionCoordinator( jdbcCoordinator, this ); entityNameResolver = new CoordinatingEntityNameResolver( factory, interceptor ); exceptionConverter = new ExceptionConverterImpl( this ); } }
final boolean traceEnabled = LOG.isTraceEnabled(); if ( traceEnabled ) { LOG.trace( "Wrapping up metadata context..." ); final PersistentClass safeMapping = (PersistentClass) mapping; if ( traceEnabled ) { LOG.trace( "Starting entity [" + safeMapping.getEntityName() + ']' ); LOG.trace( "Completed entity [" + safeMapping.getEntityName() + ']' ); final MappedSuperclass safeMapping = (MappedSuperclass) mapping; if ( traceEnabled ) { LOG.trace( "Starting mapped superclass [" + safeMapping.getMappedClass().getName() + ']' ); LOG.trace( "Completed mapped superclass [" + safeMapping.getMappedClass().getName() + ']' );
/** * Build the version attribute descriptor * * @param ownerType The descriptor of the attribute owner (aka declarer). * @param property The Hibernate property descriptor for the version attribute * @param <X> The type of the owner * @param <Y> The attribute type * * @return The built attribute descriptor */ @SuppressWarnings({"unchecked"}) public <X, Y> SingularAttributeImpl<X, Y> buildVersionAttribute( IdentifiableTypeDescriptor<X> ownerType, Property property) { LOG.trace( "Building version attribute [ownerType.getTypeName()" + "." + "property.getName()]" ); final SingularAttributeMetadata<X, Y> attributeMetadata = (SingularAttributeMetadata<X, Y>) determineAttributeMetadata( wrap( ownerType, property ), versionMemberResolver ); return new SingularAttributeImpl.Version( ownerType, property.getName(), attributeMetadata.getJpaAttributeNature(), determineSimpleType( attributeMetadata.getValueContext() ), attributeMetadata.getMember() ); }
/** * Build the identifier attribute descriptor * * @param ownerType The descriptor of the attribute owner (aka declarer). * @param property The Hibernate property descriptor for the identifier attribute * @param <X> The type of the owner * @param <Y> The attribute type * * @return The built attribute descriptor */ @SuppressWarnings({"unchecked"}) public <X, Y> SingularPersistentAttribute<X, Y> buildIdAttribute( IdentifiableTypeDescriptor<X> ownerType, Property property) { LOG.trace( "Building identifier attribute [" + ownerType.getName() + "." + property.getName() + "]" ); final SingularAttributeMetadata<X, Y> attributeMetadata = (SingularAttributeMetadata) determineAttributeMetadata( wrap( ownerType, property ), identifierMemberResolver ); return new SingularAttributeImpl.Identifier( ownerType, property.getName(), determineSimpleType( attributeMetadata.getValueContext() ), attributeMetadata.getMember(), attributeMetadata.getJpaAttributeNature() ); }
AttributeContext<X> attributeContext, MemberResolver memberResolver) { LOG.trace( "Starting attribute metadata determination [" + attributeContext.getPropertyMapping() .getName() + "]" ); final Member member = memberResolver.resolveMember( attributeContext ); LOG.trace( " Determined member [" + member + "]" ); LOG.trace( " Determined type [name=" + type.getName() + ", class=" + type.getClass().getName() + "]" );
public void warning(SAXParseException warn) { LOG.trace( extractInfo( warn ) ); } }
private void managedClose() { log.trace( "Automatically closing session" ); closeWithoutOpenChecks(); }
@SuppressWarnings("unused") private void writeObject(ObjectOutputStream oos) throws IOException { if ( log.isTraceEnabled() ) { log.trace( "Serializing " + getClass().getSimpleName() + " [" ); } if ( !jdbcCoordinator.isReadyForSerialization() ) { // throw a more specific (helpful) exception message when this happens from Session, // as opposed to more generic exception from jdbcCoordinator#serialize call later throw new IllegalStateException( "Cannot serialize " + getClass().getSimpleName() + " [" + getSessionIdentifier() + "] while connected" ); } if ( isTransactionCoordinatorShared ) { throw new IllegalStateException( "Cannot serialize " + getClass().getSimpleName() + " [" + getSessionIdentifier() + "] as it has a shared TransactionCoordinator" ); } // todo : (5.2) come back and review serialization plan... // this was done quickly during initial HEM consolidation into CORE and is likely not perfect :) // // be sure to review state fields in terms of transient modifiers // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Step 1 :: write non-transient state... oos.defaultWriteObject(); // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Step 2 :: write transient state... // -- see concurrent access discussion factory.serialize( oos ); oos.writeObject( jdbcSessionContext.getStatementInspector() ); jdbcCoordinator.serialize( oos ); }
@Override @SuppressWarnings("StatementWithEmptyBody") public void close() throws HibernateException { if ( isClosed() ) { if ( getFactory().getSessionFactoryOptions().getJpaCompliance().isJpaClosedComplianceEnabled() ) { throw new IllegalStateException( "Illegal call to #close() on already closed Session/EntityManager" ); } log.trace( "Already closed" ); return; } closeWithoutOpenChecks(); }
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException, SQLException { if ( log.isTraceEnabled() ) { log.trace( "Deserializing " + getClass().getSimpleName() ); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Step 1 :: read back non-transient state... ois.defaultReadObject(); sessionEventsManager = new SessionEventListenerManagerImpl(); // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Step 2 :: read back transient state... // -- see above factory = SessionFactoryImpl.deserialize( ois ); jdbcSessionContext = new JdbcSessionContextImpl( this, (StatementInspector) ois.readObject() ); jdbcCoordinator = JdbcCoordinatorImpl.deserialize( ois, this ); cacheTransactionSync = factory.getCache().getRegionFactory().createTransactionContext( this ); transactionCoordinator = factory.getServiceRegistry() .getService( TransactionCoordinatorBuilder.class ) .buildTransactionCoordinator( jdbcCoordinator, this ); entityNameResolver = new CoordinatingEntityNameResolver( factory, interceptor ); exceptionConverter = new ExceptionConverterImpl( this ); }