Question

I'm trying to insert some new objects into a firebird database using NHibernate.

I get the error "could not get next sequence value[SQL: SQL not available]"

Here is the mapping I'm using at present. Note ANML_EVNT is the name of the generator I want to use.

    <id name="Id" column="ID" type="integer">
        <generator class="sequence">
            <param name="sequence">ANML_EVNT></param>   
        </generator>


    </id>
Was it helpful?

Solution

If you still are looking for an answer here is how I've used it successfully.

I use the "native" generator because when adding support for SQL Server to our program the only thing in NHibernate I had to change was the generator types to "native" because Firebird and SQL Server implement their "auto incrementing identity" columns differently. In Firebird it used the named generator and in SQL Server it ignores the "sequence" parameter and uses the auto-increment built in.

Here's the example of what I'm talking about:

<id name="Id" column="ID">
   <generator class="native">
      <param name="sequence">ANML_EVNT</param>
   </generator>
</id>

With all that said, as gcores answered, all that appears to be wrong with your config is the extra ">" after ANML_EVNT.

OTHER TIPS

That looks all right. The problem is not the end bracket after ANML_EVNT, right?

 <id name="Id" column="ID" type="integer">
      <generator class="sequence">
          <param name="sequence">ANML_EVNT</param>       
      </generator>


</id>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top