1 Reply Latest reply on Jan 22, 2002 4:47 AM by katarzyna.hedlund

    My session bean cannot insert a row into the database

    katarzyna.hedlund

      I work with MS SQLServer 7.0. I have created a Session Bean with a public function, the function uses an insert-statement. When I invoke the function from a client-program, everything seems to work OK. There is no error message from JBoss neither from the client. I invoke another function from my client program, to select from the database the row I just inserted, and it returns the inserted data. That could make me convinced that the new row is inserted into database. But... I cannot see any change in the database. The insert is not "real", it exists only in JBoss. What is wrong? Isn't it possible to make insert statements from a session bean? Should I have an entity bean instead?
      Grateful for an answer - Katarzyna

        • 1. Re: My session bean cannot insert a row into the database
          katarzyna.hedlund

          I found the solution, see "Can't get insert to work properly in SQL SERVER 2000, HELP" from weepingwillow50, I followed his(her?)recomendation to make following change sin ejb-jar.xml:
          <session-type>Stateful</session-type>
          <transaction-type>Container</transaction-type>.
          And then the insert statement worked.
          But: should the session type and the transaction-type really matter in this case?