Native sequencing problem

Hi all,
I'm using Oracle9i database together with TopLink 9.0.4
and I can't get started native sequencing.
I've created a sequence using following script:
I've set up the project and session to use native sequencing, plus I've run the following code once:
Project project ="project.xml");
DatabaseSession session = project.createDatabaseSession();
SchemaManager schemaManager = new SchemaManager(session);
but it's still not working.
Then I've tried default sequencing option, but it's the same.
Only the third option using custom sequence table works.
Did anybody make it work or am I doing anything wrong?
Any help will be appreciated.

sorry, my mistake, it's ok now

Similar Messages

  • Oracle native sequencing: nextVal executed two times.

    We are migrating from Weblogic 6.1 sp 5 & TopLink 3.6.3 to Weblogic 8.1 sp 2 & TopLink 9.0.4 and we are having this issue:
    It seems that when assigning the sequence to new objets TopLink execs the nextVal for the sequence twice. In fact we probably wouldn't notticed it if it was just that, the problem is that TopLink seems to register the object into the cache with an oid and assigning the next one to the object stored in the database so we are getting NoSuchObjectException each time we try to access them.
    Here is a dump of TopLink's log showing the problem:
    [TopLink]: ServerSession(22807116)--Connection(0)--client acquired
    [TopLink]: ClientSession(25858791)--Connection(0)--acquire unit of work: 10772417
    [TopLink]: UnitOfWork(10772417)--Connection(0)--JTS register
    [TopLink]: ServerSession(22807116)--Connection(17740413)--SELECT SEQ_BOOK.NEXTVAL FROM DUAL
    [TopLink]: ServerSession(22807116)--Connection(17558511)--SELECT SEQ_PAGE.NEXTVAL FROM DUAL
    [TopLink]: UnitOfWork(10772417)--Connection(0)--Before JTS Completion
    [TopLink]: UnitOfWork(10772417)--Connection(25919386)--Begin batch statements
    [TopLink]: UnitOfWork(10772417)--Connection(25919386)--INSERT INTO AUTHOR (NAME, OCA, OID) VALUES (?, ?, ?)
    [TopLink]: UnitOfWork(10772417)--Connection(0)-- bind => [Roger Penrose, 2004-05-11 18:54:01.917, 442803]
    [TopLink]: UnitOfWork(10772417)--Connection(25919386)--End Batch Statements
    [TopLink]: ClientSession(25858791)--Connection(25919386)--Begin batch statements
    [TopLink]: ClientSession(25858791)--Connection(25919386)--INSERT INTO BOOK (NAME, OCA, OID, OID_AUTHOR) VALUES (?, ?, ?, ?)
    [TopLink]: ClientSession(25858791)--Connection(0)-- bind => [The Emperor's New Mind, 2004-05-11 18:54:01.92, 347404, 442803]
    [TopLink]: ClientSession(25858791)--Connection(0)-- bind => [Shadows of the Mind, 2004-05-11 18:54:01.943, 347405, 442803]
    [TopLink]: ClientSession(25858791)--Connection(25919386)--End Batch Statements
    [TopLink]: UnitOfWork(10772417)--Connection(0)--After JTS Completion
    [TopLink]: UnitOfWork(10772417)--Connection(0)--release unit of work
    [TopLink]: ClientSession(25858791)--Connection(0)--client released
    [TopLink]: ServerSession(22807116)--Connection(0)--client acquired
    [TopLink]: ClientSession(116689)--Connection(0)--acquire unit of work: 32580168
    [TopLink]: UnitOfWork(32580168)--Connection(0)--JTS register
    [TopLink]: UnitOfWork(32580168)--Connection(0)--Before JTS Completion
    [TopLink]: UnitOfWork(32580168)--Connection(17129104)--Begin batch statements
    [TopLink]: UnitOfWork(32580168)--Connection(17129104)--INSERT INTO AUTHOR (NAME, OCA, OID) VALUES (?, ?, ?)
    [TopLink]: UnitOfWork(32580168)--Connection(0)-- bind => [Benoit Mandelbrot, 2004-05-11 18:54:49.264, 442805]
    [TopLink]: UnitOfWork(32580168)--Connection(17129104)--End Batch Statements
    [TopLink]: ClientSession(116689)--Connection(17129104)--Begin batch statements
    [TopLink]: ClientSession(116689)--Connection(17129104)--INSERT INTO BOOK (NAME, OCA, OID, OID_AUTHOR) VALUES (?, ?, ?, ?)
    [TopLink]: ClientSession(116689)--Connection(0)-- bind => [Les objets fractals, forme, hasard et dimension, 2004-05-11 18:54:49.266, 347409, 442805]
    [TopLink]: ClientSession(116689)--Connection(0)-- bind => [The Fractal Geometry of Nature, 2004-05-11 18:54:49.282, 347408, 442805]
    [TopLink]: ClientSession(116689)--Connection(17129104)--End Batch Statements
    [TopLink]: UnitOfWork(32580168)--Connection(0)--After JTS Completion
    [TopLink]: UnitOfWork(32580168)--Connection(0)--release unit of work
    [TopLink]: ClientSession(116689)--Connection(0)--client released
    the test is about creating two objects (well, we are actually creating 6 objects in this sample as we are creating two "master" objects and adding two related (in a one to many relationship) objects to each one.)
    The thing I would like you to notice is this:
    The first AUTHOR object gets assigned the OID 442803 wether the next AUTHOR object gets the OID 442805 although we expected it to be 442804.
    The same occurs with the objects in the "many" side of the relation. They get sibiling OIDs but with a gap of two OIDs when creating the last two.
    I have been searching for simmilar problems in this forums and I found two posts:
    Both where related to a bug of an older version of TopLink (9.0.3 I think) when using something different than a number for the sequence field of an object. I expect it to be fixed in 9.0.4 version as it seemed to be fixed even for the 9.0.3 version. May it be a regression bug?
    Anyway, we are using BigDecimal on entity bean's sequence number and IIRC NUMBER(18) in Oracle tables.
    Currently our TopLink version is: 9.0.4 (031126)
    Our native sequence has an allocation size of 200 and it matches with SEQUENCEs defined in Oracle.
    As we are migratting from TopLink 3.6.3 and we have not changed the sequence prealocation size (we have not touched the database at all) we don't expect the problem to be on sequence prealocation.
    I must say we have changed the "default" JDBC driver that TopLink uses when doing the issuing the loging phase (which I think is a SUN driver) to an oracle.jdbc.driver.OracleDriver as we were having problems with timestamp locking.
    Any idea?
    Thanks in advance.

    It was my fault. I was doing a really nasty thing to the entity beans.
    I must publicly thank my work mate (which is a pretty smart girl, I must say) in tracking down this issue.
    Here is what (we think) was happening:
    As I told in previous post in this post we are in the process of moving from TopLink 3.6.3 (EJB 1.1) to TopLink 9.0.4 (EJB 2.0). We do have a "super class" in our application where we had some common things of our entity beans, i.e. entityContext, oid and oca attributes. We have also some methods that retrieve and set values from and to the entity beans via value objects (in order to avoid the heavy RMI operations when doing it through "standard" getters and setters) well, it happened that the current implementation of the "batch setting" method used the getDeclaringMethods to update in both UPDATE and INSERT opperations entity attributes with the data of the value object.
    When switching to EJB 2.0 we had to push down both the oid and oca attributes (in order of being able do deploy them) to each final entity bean and now they where being included in the setting process!
    You can imagine an scenario like this:
    1. ejbCreate() // TopLink issues the SELECT SEQ_XXX NEXT VAL FROM DUAL and sets the oid of the EJB
    2. setAttributes() // transfer info from the value object to the newly created EJB: including a setOid(null)!
    3. commit() (Before Completion)
    4. TopLink detects that the damm object surprisingly DOES NOT have the oid attribute setted so it performs another SELECT SEQ_XXX NEXT VAL FROM DUAL in order to "fix" this big problem.
    5. commit() (After Completion) // the object is written to the database with the second value from the sequence whereas the first value is used to identify the entity bean into the identity cache.
    Well it may not be "exactly" what is happening but I'm sure we are not so far from reality with our assumptions.
    Andrei Ilitchev, thanks for your interest, sorry I could not post this sooner.

  • Native sequences in DB2

    I've just read in the docs that native sequences for DB2 are not supported.
    Blissfully unaware of this, we have been using native sequencing with db2 (and toplink 9.0.3) and it worked OK. After updating to 9.0.4, it stopped working (same id is used several times).
    What is the problem with db2 sequences? Is there a plan to support them some time in the future?
    Thank you,
    Ana Oleski

    Cache connect does not cache Oracle sequences; so if you need to share the same Oracle sequence in both TimesTen and Oracle, then you will need to go to Oracle and retrieve the nextval each time.

  • Native sequence issue

    I have a News domain object which is mapped to a News table. I have inserted some sample data into the table. The newsid column reaches 81 and hence i created a sequence for this column like
    i configured toplink to use native sequencing and also set the pre-allocation size to 50.
    When do a bulk insert .,toplink registers the objects and start to assign the sequence number. When it does a call to get the sequence number, the value returned is suprising.
    2003.08.27 09:58:57.467--UnitOfWork(4435274)--Thread[Thread-22,5,main]--begin unit of work commit
    2003.08.27 09:58:57.473--ClientSession(19256680)--Thread[Thread-22,5,main]--Execute query DataReadQuery()
    2003.08.27 09:58:57.495--ServerSession(14765756)--Thread[Thread-22,5,main]--Connection(33038931)--SELECT NEWS_SEQ.NEXTVAL FROM DUAL
    2003.08.27 09:58:57.526--ServerSession(14765756)--Thread[Thread-22,5,main]--sequencing preallocation for NEWS_SEQ: objects: 50 , first: 51, last: 100
    2003.08.27 09:58:57.527--UnitOfWork(4435274)--Thread[Thread-22,5,main]--assign sequence to the object (51 -> [email protected])
    2003.08.27 09:58:57.527--UnitOfWork(4435274)--Thread[Thread-22,5,main]--assign sequence to the object (52 -> [email protected])
    when it does the insert, i get primary key constraint violation error ( since news ids 1 to 81 are already inserted as sample data).
    i have created a sequence to start with 100, but how can news_seq.nextval be 50 ( first: 51 )
    thanks in advance.

    When TopLink aquires a new sequence value with preallocation it assumes that the prevous 50 (preallocation size) of values are valid to be used.
    when we aquire 150 we assume we have 100-150, when we next aquire 200 we assume we have 150-200.
    So you need to set the START WITH to 50 > than the actualy number you wish TopLink to start with. In your case this should be 150. In general if you wish to start with 1, then START WITH 50 should be used.

  • Use oracle native sequence

    How one can use oracle native sequence in Insert/update in a Toplink POJO?
    Thanks in advance...

    Just set the Oracle Sequence name as the descriptor's sequence name (ClassDescriptor.setSequenceName()), and configure your Session to use native sequencing.
    If you are using JPA you need to use a @SequenceGenerator see,
    James :

  • Why is the  "Use Native Sequencing" option disabled ?

    I am trying Toplink with SQL Server and I have some identity fields... I see in the documentation that I should select the "Use Native Sequencing" option in the mapping properties(Database Info tab) but it is disabled(I use JDeveloper Is there any reason for this ?
    Thanks in advance.

    Native sequencing should be configurable for the SQL Server platform. I have filed a bug to track this.
    The easiest workaround is to select a different database platform (i.e. Oracle) and then enable native sequencing. You should then set it back to SQL Server. In my quick test it kept the native sequencing configuration even though it shows as disabled.

  • Problem with Oracle Native Sequencing - please help!!

    I am migrating from 3.6.5 to (huge jump).
    And have a problem with sequencing.
    When I create new object Toplink does not pick up Sequence object name from the descriptor.
    When I see generated SQL it shows:
    Each of my descriptor has it's own "..._seq" name defined in workbench.
    For DatabaseLogin i define
    As a result - no luck.
    Do I miss something, some command?

    I was doing more testing and found that the problem happens when I do

  • Native resolution problem on Boot Camp running Windows 8.1 on Macbook PRO 15 (2011)

    Couple days ago I purchased a DELL U2414h display, and I came across some problems while trying to use it with Windows 8.1 on Boot Camp.
    Everything works like a charm on MAC OS X and I get 1680x1050 resolution on my 2011 15 inch Macbook PRO, and 1920x1080 on the external DELL display.
    The problem starts when I run Windows 8.1... I get my native resolution on the Macbook, but the maximum usable resolution on the external display is 1776x1000. There's an option to choose 1920x1080, but when I do that, the screen looks blurry. Is there any way to overcome this problem?
    I'm using HDMI Adapter, and I installed all the drivers which were downloaded while installing the Boot Camp

    No I haven't, but could it be the case? The same display with the same adapter works fine while running the MAC OS X.
    But yeah, the adapter converts the mini display port to HDMI (as far as I know)
    Thanks for the reply

  • Air 2.6 Ubuntu Native Installer Problem

    Hi, i have a problem creating and native deb installer with Adobe 2.6 with Ubuntu 10.10, when i run this code on terminal:
    /home/victor/Flex_SDK/Flex_SDK_4.5.0/bin/adt -package -storetype pkcs12 -keystore /home/victor/Certificado.p12 -storepass secret -target native /home/victor/Desktop/TestNativeApp.deb TestNativeApp-app.xml TestNativeApp.swf
    This code creates an deb native installer without any errors or warnings, but when i try to execute this file, the Ubuntu Software Center says "Internal Error the file /home/victor/Desktop/TestNativeApp.deb could not be openned", but when i try to run with dpkg -i /home/victor/Desktop/TestNativeApp.deb the file installs well.
    What am i doing wrong?.
    Thanks for yours responses.

    I've got the same issue.  Ubuntu Software Center won't open it.
    When I run it with dpkg like you do, I get a version number error, though:
    parsing file '/var/lib/dpkg/' near line 2 package 'mypackage':
    error in Version string 'v1': version number does not start with digit
    Errors were encountered while processing:
    I assume this version is pulled from the air XML file, so I'm going to change that and make it only numbers and see if that fixes it.

  • Order Process Sequence Problem

    Currently I have a FM that does data from an incoming PO IDoc, makes some conversions, changes, etc.  It saves these changes into a new IDoc structure and then uses IDOC_INBOUND_ASYNCHRONOUS FM to post them to create orders.  The problem is if I have 5 IDocs (1, 2, 3, 4, 5) and I bring them in like normal, the results IDocs will sometimes come out out of sequence (5, 2, 3, 4, 1) or some other sequence.  Currently I have the partner profiles for the customer's setup so that it goes directly to my FM.  I'm trying to learn as much as I can about the process flow and how it all works.  If anyone can point me to some good documentation or knows of a better way to do this, please let me know.

    Go to SNRO t-code.
    In this t-code enter AUFTRAG object.
    This object is for Order type.
    Here you will get option No. of Numbers in buffer check it. This is the field which is responsible for number range buffering

  • GX620 Native Resolution problem

    I sent my GX620 off to MSI last week to get a problem fixed with it (still under warranty).
    It came back within 5 business days, so that was great, and the fixed what was wrong with the display - however i've just noticed something else.
    The laptop isn't letting me set the res any higher than 1280*800. The native res of a GX620 should be 1680*1050, and thats what i used to run it at before the fault occured.
    Is this a display driver thing? I have tried to update with both the latest nvidia drivers from their site, and the latest MSI display drivers from the MSI site - and neither made a difference. Also i notice my display is now listed as a 'Generic PnP Monitor on NVIDIA GeForce 9600M GT". Does that mean the display itself should have some of its own drivers that just haven't loaded right?
    The warranty service form i got back with the laptop states they swapped the LCD panel when they fixed the fault i encountered. Have they put in the wrong kind of physical display? Something that is physically limited to 1280*800, and not put in the wsxga++ screen they should have?

    You did send it to MSI directly and yourself? (not via a dealer)
    If so, show them the original box (the specs are printed on it).
    Else give me your original serial-number (printed on the BOX), with that number I can check with my MSI contacts.
    What specs your laptop should have, also (if we are lucky) what MSI did with it.
    Best call MSI if you RMA'ed with them, as it looks like they swapped the wrong panel in it.

  • Native calls problem

    Hi everybody,
    Following is my problem --
    i am working in linux environment with CLDC 1.0.4 and MIDP 2.0, downloaded from the sun site.
    earlier i was using only cldc(kvm). For adding native code, i used to rebuild kvm adding .c files containing native functions in the given makefiles. And that was working fine. but i need to use midp classes, which i am not able to use by giving
    KVM_HOME> kvm -classpath ../../api/classes:. testClass
    i am not able to use midp classes from testClass, even if i specify it in classpath...
    So, in order to use midp classes, i decided to rebuilt midp.. in midp makefiles i added .java files and corresponding .c files in SRC.. it is built without errors, but the entry of the new native function is not done in ROMjavaUnix.c or in nativeFunctionTable.c So, when i call the native function from the midlet, it obviously gives native function not found error..
    I will be higly thankful to u, if u can help me in the same. There might be a point which i am missing.
    Thanks and Regards,

    I think following shd help u...
    Following changes have been done in the MIDP RI 2.0 -
    The classes containing the native function declarations are added to the MIDP_HOME/src/share/classes/
    The corresponding C source files containing the native function definitions are added to MIDP_HOME/src/share/native/
    In MIDP_HOME/build/share/makefiles/Defs.gmk the name of the C source file is added to variable MIDP_DEF_SRC
    In MIDP_HOME/build/share/makefiles/Defs.gmk while defining variable MIDP_DEF_SOURCE, the name of the package (in our case urPackage) containing the class which contains the native function declaration is added as
    MIDP_DEF_SOURCE:=$(shell find \
    $(MIDP_DIR)/src/share/classes/java \
    $(MIDP_DIR)/src/share/classes/javax \
    $(MIDP_DIR)/src/share/classes/urpackage \
    $(MIDP_DIR)/src/share/classes/com/sun/mmedia \
    $(MIDP_DIR)/src/share/classes/com/sun/midp \
    -name '*.java' | egrep -v 'midp/ssl|$(MIDP_EXCLUDE_CLASSES)')
    In Defs.gmk (i don't remember the exact path)
    when creating the urPackage is given as
         $(ZIP) -qr ../[email protected] java javax com urPackage);

  • Oracle sequence problem in CMP Entity EJB

    I have a problem with Oracle sequence when I am using from the CMP entity EJB in WebLogic
    The problem is when the WebLogic server starts it acquires the correct sequence number
    from Oracle, but during the runtime, when I open a new sqlplus window and increment
    the sequence number, the container is not picking up from the new incremented value
    instead it is still continuining by incrementing the old sequence number it has acquired
    when it fetched from Oracle last time.
    The sequence increment and key-cache-size in weblogic-cmp-rdbms-jar.xml are exactly
    Any help would be greatly appreciated.

    Change the key-cache-size to 1 in weblogic-cmp-rdbms-jar.xml and then try
    your experiment again.
    -- Anand
    "Satya" <[email protected]> wrote in message
    news:3d06274c$[email protected]..
    I have a problem with Oracle sequence when I am using from the CMP entityEJB in WebLogic
    The problem is when the WebLogic server starts it acquires the correctsequence number
    from Oracle, but during the runtime, when I open a new sqlplus window andincrement
    the sequence number, the container is not picking up from the newincremented value
    instead it is still continuining by incrementing the old sequence numberit has acquired
    when it fetched from Oracle last time.
    The sequence increment and key-cache-size in weblogic-cmp-rdbms-jar.xmlare exactly
    Any help would be greatly appreciated.

  • URGENT: Motion JPEG?? Sequence problems

    I have a sequence that instead of having DV PAL in the settings has Motion JPEG A - will this be ok to go into DVDSP for a DVD video project??. This sequence has a few issues with frame size which I've made posts about and trying to rectify.
    In the edited sequence I changed the Motion JPEG A to DV PAL, is this ok?? I'm about to try and test this out - but wanted to ask the forum for your urgent advice.
    The 1024 x 576 frame size is wrong also - I tried making a new sequence with the 720 x 576 settings and copying and pasting my AV into the new timeline. The template graphic was ok, but the video within it is all stretched!!!
    I'm starting to panic now.. as I need to send this off for sound then to the client tomorrow first thing...
    Hope you can help.
    Cheers, Margie

    Hi Karthik,
    I'm not trying to create an animation for a webpage.  I'm exporting the movie as a JPEG sequence for use in Final Cut Pro (as it's the cleanest way to recreate a flash animation in a movie file format).  Exporting as a GIF Animation however creates the same problems as when I export as a JPEG sequence... the timelines within timelines (movie clips) don't move at all (the movie clips are animations of various carbon molecules moving in a larger animation of a lot of other things going on).  Also, exporting as a GIF Sequence yeilds the same result... foreground elements move while background elements (movie clips) don't move.  Strangely, everything DOES move when it's exported as a SWF file... except I can't use a SWF file.  I've already tried exporting the file as a MOV file and it's too graphic-intensive and causes a lot of freezing in the animation when it renders as a MOV file, and when I try using various 3rd party SWF converters to convert the file to .MOV or .DV format, it also gets bogged down by the heavy graphics and freezes and skips.
    The only way that it works is when I export it as a JPEG sequence because the computer doesn't have to render it in real time, but for some reason, movie clips within the timeline won't play.  I'm hoping someone here knows a way around this, or a setting I can toggle to make it work.  Any info would be appreciated.  Thanks for trying though Karthik!

  • Multiple destination tables, oracle sequence problems

    Please look at this sql - there is 2 steps to add data to 2 destination tables:
    - step1:
    VALUES (OB_SEQ.NEXTVAL, null, null, null, null, 'Legionowa', null, '8', '15-099', '0', null, null, 'WSSE w Białymstoku',null , 'Białystok', null, null, '0', null);
    VALUES (ZAS_SEQ.NEXTVAL, 'import', null, null, null, '0', SYSDATE, '0', null, null, null, null, KTZ_SEQ.CURRVAL, OB_SEQ.CURRVAL, (select p.id_poz_sl from pozycje_slownikow p join slowniki s on p.id_slownika=s.id_sl where s.nazwa like 'TYPY_ZASOBOW' and p.kod = 'OB'), null, '1');
    There are problems with sequences. As you can see, there is OB_SEQ.NEXTVAL in first step and OB_SEQ.CURRVAL in second step. It's impossible to define multiple destination tables in one interface. But, if I do this in multiple interfaces, OB_SEQ.CURRVAL will be undefined in second interface.
    Also, all steps should be performed row by row. So: first step for first row, second step for first row, first step for second row, second step for second row etc. This don't happen if I use multiple interfaces - first step will be performed for all source records and then, second step will be performed for the same records - this is not what I want.
    Do you have any tips what is the best way in this case?

    Unfortunately, problem is not solved still. As you can see, there are 2 sequences, from 2 not joined tables: KTZ_SEQ.CURRVAL, OB_SEQ.CURRVAL. KTZ_SEQ.CURRVAL is declared here:
    values (KTZ_SEQ.NEXTVAL, 'import', null, '0', '0', null, SYSDATE, '0', '0', '1', null, 'Jednostki WSSE', '0', null, (select p.id_poz_sl from pozycje_slownikow p join slowniki s on p.id_slownika=s.id_sl where s.nazwa like 'TYPY_ZASOBOW' and p.kod = 'OB'), '1');
    So, summary:
    - there are 2 steps (OB_SEQ.CURRVAL. KTZ_SEQ.CURRVAL) are set
    - third step: insert some hardcoded data + OB_SEQ.CURRVAL. KTZ_SEQ.CURRVAL values.
    Since KATEGORIE_ZASOBU and OBIEKTY are not joined, I can't add them as datasources in my interfaces (how to create join?) and set CURVAL?

Maybe you are looking for