Re: [hibernate-dev] Hibernate ignores 'schema' attribute of @SequenceGenerator for Oracle sequences

2012-08-13 Thread Steve Ebersole
Let's keep this on-list, thanks..

I think you are missing the point that 
'AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS' is a setting that 
*you* set.  It tells Hibernate which strategy it should use to map JPA 
generator annotations to org.hibernate.id.IdentifierGenerator 
implementations.  So its "always false" because you never set it to 
anything else...

@SequenceGenerator maps to either org.hibernate.id.SequenceHiLoGenerator 
(when flag is false) or org.hibernate.id.enhanced.SequenceStyleGenerator 
(when flag is true).  SequenceHiLoGenerator does *not* account for 
schema/catalog; SequenceStyleGenerator does.  That flag as false is 
legacy behavior.  Yes we could make SequenceHiLoGenerator (which is 
deperecated) properly account for schema/catalog.  But you could also 
enable to the new generator mappings.


On 08/13/2012 02:23 AM, mutaz kabbashi wrote:
> hi steve
>
> i mean the (USE_NEW_ID_GENERATOR_MAPPINGS) always = false for example
>
> if i create the following entity class
>
> package bugs.HHH_7232;
>
> import javax.persistence.*;
>
> @Entity
> @Table(name = "test", schema = "jaseadm")
>
> @SequenceGenerator(schema="hibernate_bug",
> name="applicantSignupSequence", sequenceName="seq_applicant_signup" )
> public class SeqTest {
>  @Id
>  @GeneratedValue(generator = "applicantSignupSequence",
>  strategy = GenerationType.SEQUENCE)
>  private int id;
>
> }
>
> hibernate should use sequence from (hibernate_bug) schema but it
> doesn't because when hibernate checks
> (USE_NEW_ID_GENERATOR_MAPPINGS) consatnt @buildIdGenerator() method
> @org.hibernate.cfg.AnnotationBinder Class using the following variable
> (final boolean useNewGeneratorMappings =
> mappings.useNewGeneratorMappings() ;)  which always  returns false
>
> below is the body of useNewGeneratorMappings()
> met...@org.hibernate.cfg.Configuration class
> @SuppressWarnings({ "UnnecessaryUnboxing" })
>   public boolean useNewGeneratorMappings() {
>   if ( useNewGeneratorMappings == null ) {
>   final String booleanName = 
> getConfigurationProperties()
>   .getProperty( 
> AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS ); //problem
>   useNewGeneratorMappings = Boolean.valueOf( 
> booleanName );
>   }
>   return useNewGeneratorMappings.booleanValue();
>   }
>
>
>
>
>
> On Sun, Aug 12, 2012 at 8:15 PM, Steve Ebersole  wrote:
>> Not following what you mean "'use new id generator mappings' is false all
>> the time".
>>
>> On Aug 12, 2012 3:40 AM, "mutaz kabbashi"  wrote:
>>>
>>> hi all
>>>
>>>  i am new here and  i  want  to contribute to hibernate so i
>>> started with simple bug (Hibernate ignores 'schema' attribute of
>>> @SequenceGenerator for Oracle sequences HHH-7232)
>>> (https://hibernate.onjira.com/browse/HHH-7232) , after i checked the
>>> code i found out  that when hibenate try to parse @SequenceGenerator
>>> annotation of Entity class it checks (USE_NEW_ID_GENERATOR_MAPPINGS )
>>> constatnt @[org.hibernate.cfg.AvailableSettings.java] which will be
>>> false  all the time so hibernate will not read the sequence schema .
>>>so what is the best way to solve this problem
>>>
>>>
>>>
>>>- Change USE_NEW_ID_GENERATOR_MAPPINGS value (could make problem
>>> with backward compatibility)
>>>
>>>   - create new constant
>>>
>>> - check @sequenceGenerator and get schema name  (if schema is present
>>> get schema name else schema name will be null )
>>>
>>> - any suggestion
>>>
>>> thank you
>>> ___
>>> hibernate-dev mailing list
>>> hibernate-dev@lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/hibernate-dev

-- 
st...@hibernate.org
http://hibernate.org
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


Re: [hibernate-dev] infinispan tests

2012-08-13 Thread Galder ZamarreƱo
If you can reproduce this easily, enable TRACE on org.infinispan and 
org.jgroups and send me the logs.

On Aug 8, 2012, at 7:26 AM, Strong Liu wrote:

> I'm seeing lots of infinispan test failures, I guess mostly relate to the 
> jgroups, propbaly an environment issue, wondering anyone has a workaround?
> 
> 
> 
> java.lang.IllegalStateException: Cache at address server-15967 had 3 members; 
> expecting 2. Members were (server-64288, server-15967, server-6121)
>   at 
> org.infinispan.test.TestingUtil.isCacheViewComplete(TestingUtil.java:510)
>   at 
> org.infinispan.test.TestingUtil.areCacheViewsComplete(TestingUtil.java:427)
>   at 
> org.infinispan.test.TestingUtil.areCacheViewsComplete(TestingUtil.java:419)
>   at 
> org.infinispan.test.TestingUtil.blockUntilViewsReceived(TestingUtil.java:244)
>   at 
> org.infinispan.test.TestingUtil.blockUntilViewsReceived(TestingUtil.java:290)
>   at 
> org.infinispan.test.TestingUtil.blockUntilViewsReceived(TestingUtil.java:953)
>   at 
> org.hibernate.test.cache.infinispan.entity.AbstractEntityRegionAccessStrategyTestCase.waitForClusterToForm(AbstractEntityRegionAccessStrategyTestCase.java:117)
>   at 
> org.hibernate.test.cache.infinispan.entity.AbstractEntityRegionAccessStrategyTestCase.prepareResources(AbstractEntityRegionAccessStrategyTestCase.java:112)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:601)
>   at 
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
>   at 
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>   at 
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
>   at 
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
>   at 
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
>   at 
> org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:62)
> 
> 
> ReadOnlyTestCase.testCacheConfiguration
> ReadOnlyTestCase.testEvict
> ReadOnlyTestCase.testEvictAll
> ReadOnlyTestCase.testGetRegion
> ReadOnlyTestCase.testInsert
> ReadOnlyTestCase.testPutFromLoad
> ReadOnlyTestCase.testPutFromLoadMinimal
> ReadOnlyTestCase.testRemove
> ReadOnlyTestCase.testRemoveAll
> ReadOnlyTestCase.testUpdate
> EntityCollectionInvalidationTestCase.testAll
> 
> -
> Best Regards,
> 
> Strong Liu 
> http://about.me/stliu/bio
> 
> ___
> hibernate-dev mailing list
> hibernate-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev

--
Galder ZamarreƱo
Sr. Software Engineer
Infinispan, JBoss Cache


___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev