The record is not added into the table.

Hi,
I am new to Hibernate.
I have contact.hbm.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="Contact" table="CONTACT">
<id name="id" type="string" column="ID" >
<generator class="assigned"/>
</id>
<property name="firstName">
<column name="FIRSTNAME" />
</property>
<property name="lastName">
<column name="LASTNAME"/>
</property>
<property name="email">
<column name="EMAIL"/>
</property>
</class>
</hibernate-mapping>
And I have hibernate.cfg.xml
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">sun.jdbc.odbc.JdbcOdbcDriver</property>
<property name="hibernate.connection.url">jdbc:odbc:test</property>
<property name="hibernate.connection.username"></property>
<property name="hibernate.connection.password"></property>
<property name="hibernate.connection.pool_size">10</property>
<property name="show_sql">true</property>
<!-- <property name="dialect">org.hibernate.dialect.MySQLDialect</property> -->
<property name="dialect">com.hxtt.support.hibernate.HxttAccessDialect</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<!-- Mapping files -->
<mapping resource="contact.hbm.xml"/>
</session-factory>
</hibernate-configuration>
And my client program to add a record into the table is as follows..
File f=new File("..src/com/hibernateaction/chapter01/hello/hibernate.cfg.xml");
Configuration cfg = new Configuration().addFile(f);
Iterator itr=cfg.getClassMappings();
while(itr.hasNext())
     System.out.println("V="+itr.next());
SessionFactory sessionFactory = cfg.configure().buildSessionFactory();
session =sessionFactory.openSession();
System.out.println("Inserting Record");
Contact contact = new Contact();
contact.setId("3");
contact.setFirstName("Senniappan");
contact.setLastName("Gounder");
contact.setEmail("[email protected]");
session.save(contact);
System.out.println("Done");
session.flush();
session.close();
The output displayed as "Done" and "Hibernate: insert into CONTACT (FIRSTNAME, LASTNAME, EMAIL, ID) values (?, ?, ?, ?) ".
But there is no record is added into the DB.
Kindly help in this regards.

I used transaction.commit() it workd fine. Thanks Balu.
My query is, is it necessary to start a transaction to add a single row into the table? Could u brief about this implementation?

Similar Messages

  • Events invitations are note added into the Calendar

    I have a back end and front end calendar 6.3 environment with convergence connecting to the front end. When [email protected] invite the [email protected] to an event only an email notification of the event is sent to the userB, the invitation is not added into the userB calendar, in order to accept, decline or cancel the invitation.
    For this environment i have both iwc and uwc active, but no matter what interface I use the behavior is the same.
    My question is:
    1. In a back end and front end calendar environment how should sent the emails notifications?
    2. Why userB can´t see the invitation userA sent to him?
    3. Where and how I can verifity the invitation is sent? in the back end / front end?
    I saw the thread http://forums.sun.com/thread.jspa?threadID=5432165. But the users have all the icsExtendedUserPrefs attributes. I also set the variables user.cal.enablenotify and user.cal.enableinvitenotify but still not getting the invitation within the calendar.
    Products version:
    Sun Convergence 1.0-12.01 (built January 16 2010 - 21:38:59)
    Sun Java(tm) System Calendar Server 6.3-20.01 (built Oct 23 2009)
    Sun Java(tm) System Messaging Server 7.3-11.01 64bit (built Sep 1 2009)
    libimta.so 7.3-11.01 64bit (built 19:54:45, Sep 1 2009)

    Duplicate thread, refer to:
    http://forums.sun.com/thread.jspa?threadID=5437550

  • Issue with the new COPA field added into the BBSEG Structure

    Hello All,
    I have an issue with the new COPA field added into the BBSEG Structure.
    I think its added becuase of test Operationa Conern Created by somebody.
    Can you please let me know how to remove that structure from BBSEG Structure.
    Thanks
    vsr

    Hi Monohar & Ankur,
      Thanks for your answers..
      main issue is suddenly new field called RKE_COPA_KOSTL has  been added to the BBESG Structure..
      Because of this RFBIBL00 Upload is not working. I heard that  this new fields will come by generating Operating Concerns by Transaction KEA0.I found an operating concern which was created as a test in developemt system..
      But I am not sure how to delete that operating concern.Even i am not sure if we delete the Operating Concern ..is it going to delete that field in BBESG Structure or not??
    Please advise me..
    Thanks
    sathi

  • I recently bought a Macbook Air and a Thunderbolt Display and the laptop's power is supposed to come from the display, but the power cable on the display does not fit into the Macbook Air.

    I recently bought a 11" Macbook Air and a 27" Thunderbolt Display.The laptop's power is supposed to come from the display when connected, but the power cable on the display does not fit into the Macbook Air.

    If your MBair is a 2012 model, it has a Magsafe 2 power connection.  The monitor probably has the old magsafe connection.  If this is the case, you need this adapter.
    http://store.apple.com/us/product/MD504ZM/A?fnode=5a

  • Record Management. Search record by objects added into the record

    Hi all,
    We would like to navigate from the gos (generic object service) of a  business object to the record where this object is added. In principle the object will be added just to one record and it will be manually added from the organizer in the specific record. The point is that when someone is at the business object and at the gos press the record button, will navegate to the record.
    Our problem is how without adding any specific field can we know the record where this object was previously manually added.
    Any ideas? I was thinking of updating the attributes of the record (for example reference) after the object is added in the organizer, with the value of the object but I don´t know if there is a exit o service I could use when the object is added, the could give me the value of the object and also how to get the record values in order to update its attributes.
    Apart from this, can anyone tell me, in the definition of a record model, for an object model node, what the relationship  is used for? or where to find documentation, because I hope I could set a relationship with the record and the object that aftewards could be useful for my problem but when clicking there it just appear an screen with Available relationship _ Other objects but I can set any object o parameter and also in a record object I don´t find anything related with this.
    Best regards and thanks for the help

    Dear Pablo,
    Try this...
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0c5d6a5-71f7-2c10-d6ac-c476b82a9c87
    or
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40be7649-72f7-2c10-03b9-c85d56eff2e5
    You can find more cookbooks in here...
    SAP Netweaver Folder Management (ex-Records Management) [original link is broken]
    Best Regards,
    Pragya

  • Record is not inserting into the Table thourgh forms 10g

    Hi All,
    I have the form built in 10g(10.1.2.0.2).
    Basically the form has 2 blocks.
    Block 1 with only one item, where we enter some value and hit enter(this will navigate to block2 and execute the query).
    Block 2(tabular) will fetch the records. Now this block2 have 3 columns(caseid, userid, date).
    Now when I insert a new record, I just need to enter the caseid only. And userid and date have to be automatically populated.
    I can populate the USERID and DATE fields.
    And when I enter some value in caseid item of block 2, and then do Control+S(to insert the record and Save the transaction),
    i get the message saying FRM-40400: Transaction complete: 1 records applied and saved.
    But when I query again for the same, I dont se the record inserted into the table.
    Why is this happening?
    Help please...

    @ Inol
    There is no promary or foriegn key relation ship. The form is fetching records from just one table. As I said block1 has col1. and Block2 has col2,3,4.
    @Andreas
    Yes I did select * from table, select count(*) from table in SQL*Plus. Nothing is inserted.
    And one thing I have to tall here is, I have a ON-INSERT trigger in block2.
    The code in ON-INSERT trigger is
    --  :BLOCK2.DATE := TO_DATE(:DATE,'DD-MON-YYYY') ;
    /* commented since I was populating date by assigning $$DATETIME$$ to the Initial value property of the data item. */
    :BLOCK2.SOURCE_CASE := :BLOCK1.SOURCE_CASEID;Forgot to tell you,
    Since I was inserting the record from block2(3 columns), to the table which has 4 columns, there is another item in block 2 which has the visible property No.
    So the block 2 has 4 columns. And the hidden column will hold the value that is in the item of block1. This is what i'm pushing in the ON-INSERT trigger.
    Edited by: Charan on Sep 20, 2011 1:51 PM

  • In Firefox window below toolbar, I am unable to click on links in the upper part of the window, ie the cursor does not change into the hand icon and the link is not highlighted.

    The toolbar and the lower part of the window works normally, as does the whole window in Internet Explorer.
    I have reinstalled Firefox with no improvement.

    Many thanks SafeBrowser; I think the Yahoo and Babylon extensions were the problem. Didn't want them anyway!

  • Record not inserting into the table through Forms 10g

    Hi all,
    I have created a form in 10g(10.1.2.0.2) based on just one table that has 4 columns(col1, col2, col3, col4).
    Here col1, col2 and col3 are VARCHAR2 and col4 is date and all the columns are not null columns(There are no primary and foriegn key constrains, which means duplicates are allowed).
    My form contains 2 blocks where block 1 has one text item (col1) and 3 buttons (Delete, Save, Exit).
    And block2 is a database block and has col2,col3,col4 which are in tabluar layout frame displaying 10 records.
    When the form is opened the cursor has to be in block1.col1 for querrying. Here i enter a value in col1, and then when I click on col2 in the block2, then I put execute_query in new_block_instance of block2, which displays the records.
    The block2 properties are not updatable, insertable and query is allowed.
    Everything is working good until here. But here in the block2 when I want to insert another record into the table, by navigating all the way down to the last empty record and entering the new values for col2, col3 and col4 And then Ctrl+S will display the message "*FRM-40400: Transaction complete: 1 record applied and saved.*" But actually the record is not inserted into the table.
    I also disabled the col4 by setting the Enabled property to No, since while inserting new record the date have to be populated into it and it shouldnt be changed by the user. And im populating the sysdate into the new record by setting Intial Value property to *$$DATE$$*.
    And another requirement which I could not work arround here is that, the col3 also should be populated with the username of the user while inserting.
    please help me...

    Hi Sarah,
    I do not want to update the existing record. So I kept Udate Allowed to No in property palette for the items in block2.
    Do I have to do this property at block level also?
    I'm inserting a new record here.
    Edited by: Charan on Sep 19, 2011 8:48 AM

  • Encoder opens and  project is not added to the render (bug with several plugins)

    if i apply Neat Video Plugin in After Effects
    and send to the renderer in the media encoder
    Encoder opens and the project is not added to the render
    if i remove this plugin in Ae
    and again send to render it all works!
    What's the problem?
    Last Ae cc 2014 and Encoder
    Maveriks 10.9.3

    Sorry, I didn't really hit the problem with this post.
    I had just downloaded 9.0.3.2 and was trying to check if some critical problems we had were indeed fixed in the patch. As I realized myself later, my assumptions were wrong (but not the final results, unfortunately).
    After another couple of days of debugging, I was able to identify the real problem, which I posted in BC4J: association accessor problem
    As you can notice from the other thread, the issue is not that the entity row is not added to the cache (this is false), but that a second use of the association accessor will not "see" the new row - took me some time to understand the "slight" difference ;)
    Maybe you could check that issue and suggest me a workaround...
    TIA,
    Adrian

  • Sales contracts could not coming into the KE24

    Hi,
    Only sales contracts(VA43) not coming ito the KE24
    But whenever we created the sales order with reference to the sales contracts then that time its appearing into the ke24
    why only sales contracts(do not having the Sales orders) not coming into the KE24
    Is it requires any config for this

    Hi
    Contaract is not standard charactor in co-pa thats y only contract it won be appear in the ke 24 report . if you are using contract with reference to sales order when you are doing the billing system it will take both sale order and coanaract fields it will update in co-pa .
    If you want to take contaract in to co-pa without sales order u have to create charactor strics dervation rule in KEDR transaction then it will update in copa .

  • Data is not populate into base table

    Hi all,
    I am using Oracle EBS R12 and OS is WIN XP. I am working in PO module.The data is not populating into the base table after running the concurrent program.Instead,the interface error table is populated with the error.
    The error is :-- Bill to location id not valid
    Name of concurrent program:import Standard purchase order

    Pl identify which version of R12. Pl see if these MOS Docs can help
    Vision Demo - How To Import Standard Purchase Orders Using the Purchase Document Open Interface          (Doc ID 1054004.1)
    How To Diagnose Problems With Importing Standard Purchase Orders          (Doc ID 781351.1)
    HTH
    Srini

  • Value not reflecting into the transparent table when checked through se11

    Hi friends.    i am using the following code to add data to a transparent table already creted by me.Now i am adding data to it through a ABAP program.It is displaying the output when I execute it but the new record added in the program is not saved itno the table actually.my code is :
    REPORT  ZWRITE_DATA.
    tables zlfa2.
    move 'achal' to zlfa2-field_name_1.
    update zlfa2.
    select * from zlfa2.
    write / zlfa2-field_name_1.
    endselect.
    the above code is not showing the value 'achal' in it.and also no error message is being displayed.

    Hi,
    Commit work saves the changes done into the database. Using COMMIT WORK statement in your program have below mentioned effect:
    Calls the subroutines specified by PERFORM ... ON COMMIT
    Executes asynchronously any update requests (see CALL FUNCTION ... IN UPDATE TASK) specified in these subroutines or started just before
    Processes the function modules specified in CALL FUNCTION ... IN BACKGROUND TASK
    Resets the time slice counter to 0.
    Ensures that the locks of the SAP locking concept are handled in accordance with its SCOPE Parameter.
    Executes a database commit on all database connections
    Closes all open database cursors (OPEN CURSOR) on all database connections
    Releases all database locks on all database connections
    KR Jaideep,

  • Multi-table mapping is not inserting into the primary table first.

    I have an inheritance mapping where the children are mapped to the parent table oids with the "Multi-Table Info" tab.
    One of children is not inserting properly. Its insert is attempting to insert into one of the tables from the "Additional Tables" of "Multi-Table Info" instead of the primary table that it is mapped to.
    The other children insert correctly. This child is not much different from those.
    I looked through the forums, but found nothing similiar.

    I would expect the Children to be inserted into both the primary table and the Additional Table? Is the object in question inserted into the primary table at all? Is the problem that it is being inserted into the Additional Table first? If it is, are the primary key names different? Is it a foreign key relationship?
    If the object in question has no fields in the additional table is it mapped to the additional table? (it should not be)
    Perhaps providing the deployment XML will help determine the problem,
    --Gordon                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • I am a BT Yahoo customer using Apple Mail, on iMac, iPad iPhone, 4 to 8 times a week sent mail is not delivered into the sent mail box and I have no record of the sent e-mail or its content. BT say it's an apple problem. Any help would be appreciated. Ted

    I am a BT Yahoo customer using Apple Mail, on iMac, iPad iPhone, 4 to 8 times a week sent mail is not delivered into the sent mail box and I have no record of the sent e-mail or its content. BT say it’s an apple problem. Any help would be appreciated. Ted

    Hello,
    Are they just regular size eMails?
    Do you have more than one eMail account setup?
    Next time it happens, get...
    Find Any File...
    http://apps.tempel.org/FindAnyFile/
    Hold Option or alt key when selecting Find to Find All.
    Use it to Find All, for Name ends in...
    .emlx
    (dot ee em el ex)
    And Modification Date, is within, the last 5 minutes or whatever.

  • Urgent:-Values are not inserted into the custom table

    Hi, I am inserting the data from the custom OAF form into a custom table. Only the WHO columns are populated into the table but no field value is populated into the custom table. I have written the following code -
    In CO
    if (pageContext.getParameter("Continue") != null)
    OAApplicationModule am = pageContext.getRootApplicationModule();
    OAViewObject CwkInfo = (OAViewObject)am.findViewObject("CWKInfoVO1");
    am.invokeMethod("initializevo");
    in AM
    public void initializevo()
    CWKInfoVOImpl testVo = (CWKInfoVOImpl) this.getCWKInfoVO1();
    testVo.insertRow(testVo.createRow());
    getTransaction().commit();
    Urgent Help is required.
    Regards,
    Ashish

    Hi Ashish,
    Double check whether you have attached the correct EO based VO attribute to the columns.
    In the Controller
    Process Request use the following code:-
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (!pageContext.isFormSubmission())
    am.invokeMethod("initQuery", null);
    ProcessForm Request
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    System.out.println("Inside Process Form Request");
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (pageContext.getParameter("submitButton")!=null)
    am.invokeMethod("submit")
    AM Code
    public void initQuery()
    OAViewObject vvo = (OAViewObject)getEmployeeEOVO1();//Give you EO based VO Name
    if (!vvo.isPreparedForExecution())
    vvo.executeQuery();
    Row row = vvo.createRow();
    vvo.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    public void submit()
    getTransaction().commit();
    Import necessage classes.
    Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • Please specify short text more precisely

    Hello All when i create a free text sc and reffered a material group GOA item text are same. sc description text = goa item text same (product category GOA) i get this error "Please specify short text more precisely" while creating a PO (classic) SAP

  • How to Avoid Open Sales Order Value from Credit Check

    Hello Everyone, We have a problem with Credit Management, When my user run the execute credit master sheet, system is considering open sales order value under Credit limit used. My user do not want consider open sales order value, they want only Open

  • How to look at sap exit  for bex variable

    hi gurus how can i read a sapexit for a standard variable created by sap. i need to replicate that same code and modify it and make my own user exit for a custom variable. thanks

  • Calling a method in BPM Object from jsp page

    hi all, I try to call a method from BPM Object using <f:invokeUrl > I change server side method properties to yes. and then how can i get request and response object inside the BPM method. Thanks.

  • Plz help anyone who know how to fix my notification badge in itunes plz give an idea how to do ?

    i cant used properly my apps like fb , youtube ang other apps because of the notification badge. they have a notice everytime i open the apps "connect the itunes to used the push notification" anyone who have experience this problem in their iphone,