Re: [hibernate-dev] SchemaCreatorImpl always creating a poolable sequence

2016-07-30 Thread Mark Rotteveel
On 28-7-2016 18:07, Steve Ebersole wrote:
> I do think this is an error.  I think the proper fix is to first
> make use of Exporter#getSqlCreateStrings via
> Dialect#getSequenceExporter.
>
> From there, either:
>
>  1. Change the standard Exporter to look at
> Dialect#supportsPooledSequences and deciding which
> Dialect#getCreateSequenceStrings form to call
>  2. Change Firebird's Exporter impl

I have fixed the immediate problem by implementing the 
getCreateSequenceStrings(String, int, int) and 
getCreateSequenceString(String, int, int) as:

@Override
public String[] getCreateSequenceStrings(String sequenceName, int 
initialValue, int incrementSize) throws MappingException {
 return new String[] {
 getCreateSequenceString( sequenceName, initialValue, 
incrementSize ),
 "alter sequence " + sequenceName + " restart with " + 
(initialValue - 1)
 };
}

@Override
protected String getCreateSequenceString(String sequenceName, int 
initialValue, int incrementSize)
 throws MappingException {
 if (incrementSize > 1) {
 throw new MappingException( getClass().getName() + " does not 
support pooled sequences" );
 }
 // Ignore initialValue and incrementSize
 return getCreateSequenceString( sequenceName );
}

So as long as a non-pooled sequence (incrementSize = 1) is requested the 
Firebird25Dialect will happily oblige. I will add a similar solution to 
the InterbaseDialect and FirebirdDialect.

> I'd also suggest we properly deprecate Dialect#supportsPooledSequences,
> Dialect#getCreateSequenceStrings directing to Dialect#getSequenceExporter.

The problem with that is that the StandardSequenceExporter uses 
getCreateSequenceStrings to do its work, so deprecating that would 
require more rework.

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


Re: [hibernate-dev] SchemaCreatorImpl always creating a poolable sequence

2016-07-30 Thread Steve Ebersole
Moving this functionality into the Exporter is the correct answer.
Eventually those DIalect methods will go away.

On Sat, Jul 30, 2016 at 3:32 AM Mark Rotteveel  wrote:

> On 28-7-2016 18:07, Steve Ebersole wrote:
> > I do think this is an error.  I think the proper fix is to first
> > make use of Exporter#getSqlCreateStrings via
> > Dialect#getSequenceExporter.
> >
> > From there, either:
> >
> >  1. Change the standard Exporter to look at
> > Dialect#supportsPooledSequences and deciding which
> > Dialect#getCreateSequenceStrings form to call
> >  2. Change Firebird's Exporter impl
>
> I have fixed the immediate problem by implementing the
> getCreateSequenceStrings(String, int, int) and
> getCreateSequenceString(String, int, int) as:
>
> @Override
> public String[] getCreateSequenceStrings(String sequenceName, int
> initialValue, int incrementSize) throws MappingException {
>  return new String[] {
>  getCreateSequenceString( sequenceName, initialValue,
> incrementSize ),
>  "alter sequence " + sequenceName + " restart with " +
> (initialValue - 1)
>  };
> }
>
> @Override
> protected String getCreateSequenceString(String sequenceName, int
> initialValue, int incrementSize)
>  throws MappingException {
>  if (incrementSize > 1) {
>  throw new MappingException( getClass().getName() + " does not
> support pooled sequences" );
>  }
>  // Ignore initialValue and incrementSize
>  return getCreateSequenceString( sequenceName );
> }
>
> So as long as a non-pooled sequence (incrementSize = 1) is requested the
> Firebird25Dialect will happily oblige. I will add a similar solution to
> the InterbaseDialect and FirebirdDialect.
>
> > I'd also suggest we properly deprecate Dialect#supportsPooledSequences,
> > Dialect#getCreateSequenceStrings directing to
> Dialect#getSequenceExporter.
>
> The problem with that is that the StandardSequenceExporter uses
> getCreateSequenceStrings to do its work, so deprecating that would
> require more rework.
>
> Mark
> --
> Mark Rotteveel
>
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


Re: [hibernate-dev] Preparing for 5.0.10 and 5.1.1 releases

2016-07-30 Thread Steve Ebersole
Do you need me to do anything in regards to HHH-10896 for these?


On Fri, Jul 29, 2016 at 6:55 PM Gail Badner  wrote:

> I'm wrapping things up to release 5.0.10 and possibly 5.1.1 this weekend.
>
> Please do not push any commits to 5.0 or 5.1 branches.
>
> Thanks,
> Gail
> ___
> hibernate-dev mailing list
> hibernate-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


Re: [hibernate-dev] SchemaCreatorImpl always creating a poolable sequence

2016-07-30 Thread Steve Ebersole
FYI... https://hibernate.atlassian.net/browse/HHH-11010

ATM I have this scheduled for 6.0.  In an ideal world we would have
performed these deprecations in 5.2 also and removed the deprecated methods
in 6.0.  I can certainly be convinced to do this deprecation in 5.2 however
:)


On Sat, Jul 30, 2016 at 7:11 AM Steve Ebersole  wrote:

> Moving this functionality into the Exporter is the correct answer.
> Eventually those DIalect methods will go away.
>
>
> On Sat, Jul 30, 2016 at 3:32 AM Mark Rotteveel 
> wrote:
>
>> On 28-7-2016 18:07, Steve Ebersole wrote:
>> > I do think this is an error.  I think the proper fix is to first
>> > make use of Exporter#getSqlCreateStrings via
>> > Dialect#getSequenceExporter.
>> >
>> > From there, either:
>> >
>> >  1. Change the standard Exporter to look at
>> > Dialect#supportsPooledSequences and deciding which
>> > Dialect#getCreateSequenceStrings form to call
>> >  2. Change Firebird's Exporter impl
>>
>> I have fixed the immediate problem by implementing the
>> getCreateSequenceStrings(String, int, int) and
>> getCreateSequenceString(String, int, int) as:
>>
>> @Override
>> public String[] getCreateSequenceStrings(String sequenceName, int
>> initialValue, int incrementSize) throws MappingException {
>>  return new String[] {
>>  getCreateSequenceString( sequenceName, initialValue,
>> incrementSize ),
>>  "alter sequence " + sequenceName + " restart with " +
>> (initialValue - 1)
>>  };
>> }
>>
>> @Override
>> protected String getCreateSequenceString(String sequenceName, int
>> initialValue, int incrementSize)
>>  throws MappingException {
>>  if (incrementSize > 1) {
>>  throw new MappingException( getClass().getName() + " does not
>> support pooled sequences" );
>>  }
>>  // Ignore initialValue and incrementSize
>>  return getCreateSequenceString( sequenceName );
>> }
>>
>> So as long as a non-pooled sequence (incrementSize = 1) is requested the
>> Firebird25Dialect will happily oblige. I will add a similar solution to
>> the InterbaseDialect and FirebirdDialect.
>>
>> > I'd also suggest we properly deprecate Dialect#supportsPooledSequences,
>> > Dialect#getCreateSequenceStrings directing to
>> Dialect#getSequenceExporter.
>>
>> The problem with that is that the StandardSequenceExporter uses
>> getCreateSequenceStrings to do its work, so deprecating that would
>> require more rework.
>>
>> Mark
>> --
>> Mark Rotteveel
>>
>
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev