Beth

O.K. I tried it now and can report that it does not work. After reviewing
the code I understand why not. This is the function that checks if sequences
are supported in reactor\data\oracle\Convention.cfc

   <cffunction name="supportsSequences" access="public" hint="I indicate if
the DB support sequences" output="false" returntype="any"
_returntype="boolean">
       <cfreturn true />
   </cffunction>


So basically if I am using Oracle the code below is going to run and
increment it by two instead of one. For now I guess I will have to comment
out the block of code that creates that section in dao.project.xsl.

Unless someone has a better idea.

Bryan

On 2/23/07, Beth Bowden <[EMAIL PROTECTED]> wrote:

Bryan,

Off the top of my head, I suggest removing the line in the config file
that specifies a sequence for that table.

HTH

Beth

On 2/23/07, Bryan S <[EMAIL PROTECTED]> wrote:
> Using Oracle.
>
> I have a sequence set up on the ID fields on my tables. I have a trigger
> that increments the sequences automatically when a record is entered.
This
> works fine in a DB administrator. When I add a record using reactor the
key
> increments by two. I figured out why but I need to know the best way to
work
> around this... assuming it isn't a bug.
>
> In my TABLE_NAMEDao.cfc the create function has the code below in it. If
I
> comment this block of code out the problem stops. qCreate returns a key
> field that is correctly incremented by one. However, when the record is
> inserted the key field jumps an additional one because of my trigger.
>
> It seems that Reactor is recognizing that Oracle supports sequences but
not
> that I have a trigger so it doesn't have to increment it for me.
>
> How do I tell Reactor that I'm handling this?
>
>             <cfif Convention.supportsSequences()>
>
>                         <cfquery name="qCreate"
> datasource="#_getConfig().getDsn()#"
> username="#_getConfig().getUsername()#"
> password="#_getConfig().getPassword()#">
>
> #Convention.getNextSequenceSyntax("S_DEV_PLATFORM")#
>                         </cfquery>
>                         <cfset
> arguments.to.DVP_APP_PLATFORM_ID = qCreate.ID />
>
>             </cfif>



-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to