You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Mahler Thomas <th...@itellium.com> on 2003/05/09 15:28:41 UTC
FW:
-----Original Message-----
From: Bogdan [mailto:bsturzoiu@go.ro]
Sent: Friday, May 09, 2003 9:23 AM
To: thma@apache.org
Subject:
Hi!
I have a problem with persistence broker!
Can you tell me what is wrong with it?
So:
1) I use win2k proffesional
2) I use Oracle 9i JDeveloper
3) I use SQL server 2000
4) I use Persistence Broker
5) I have a Session EJb, stateless
6) Inside of this component i have the following method:
public void Delete()
{
PersistenceBroker broker = null;
try
{
broker =
PersistenceBrokerFactory.createPersistenceBroker("SQLServer","sa","");
}
catch (Throwable t)
{
t.printStackTrace();
}
PersonVO example = new PersonVO();
example.setPersonId(new BigDecimal(7));
Query query = new QueryByCriteria(example);
try
{
broker.beginTransaction();
PersonVO toBeDeleted = (PersonVO) broker.getObjectByQuery(query);
broker.delete(toBeDeleted);
broker.commitTransaction();
}
catch (Throwable t)
{
broker.abortTransaction();
t.printStackTrace();
}
}
7) I will atach to this mail an archive with:
a) OJB.properties
b) repository.xml
c) repository_database.xml
d) repository_user.xml ()
8) The script to create the table Person is:
CREATE TABLE [dbo].[PERSON] (
[PKID] [numeric](18, 0) NOT NULL ,
[COD] [numeric](18, 0) NOT NULL ,
[NAME] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[DATA_INI] [datetime] NULL ,
[DATA_FIN] [datetime] NULL ,
[MGR_ID] [numeric](18, 0) NULL
) ON [PRIMARY]
GO
The problem is:
I can'n make any persistent modifications in the database!
What is the cause, can you tell me?
Thank you very much!
Re:
Posted by Armin Waibel <ar...@code-au-lait.de>.
Do you use Connection/DataSource from
your appServer via JNDI in repository_database.xml?
e.g.
<jdbc-connection-descriptor
jcd-alias="default"
default-connection="true"
platform="Hsqldb"
jdbc-level="2.0"
jndi-datasource-name="java:DefaultDS"
username="sa"
password=""
>
regards,
Armin
>
> -----Original Message-----
> From: Bogdan [mailto:bsturzoiu@go.ro]
> Sent: Friday, May 09, 2003 9:23 AM
> To: thma@apache.org
> Subject:
>
>
> Hi!
>
> I have a problem with persistence broker!
> Can you tell me what is wrong with it?
>
>
> So:
> 1) I use win2k proffesional
> 2) I use Oracle 9i JDeveloper
> 3) I use SQL server 2000
> 4) I use Persistence Broker
>
> 5) I have a Session EJb, stateless
> 6) Inside of this component i have the following method:
> public void Delete()
> {
> PersistenceBroker broker = null;
> try
> {
> broker =
> PersistenceBrokerFactory.createPersistenceBroker("SQLServer","sa","");
> }
> catch (Throwable t)
> {
> t.printStackTrace();
> }
>
> PersonVO example = new PersonVO();
> example.setPersonId(new BigDecimal(7));
>
> Query query = new QueryByCriteria(example);
>
> try
> {
> broker.beginTransaction();
> PersonVO toBeDeleted = (PersonVO)
broker.getObjectByQuery(query);
> broker.delete(toBeDeleted);
> broker.commitTransaction();
> }
> catch (Throwable t)
> {
> broker.abortTransaction();
> t.printStackTrace();
> }
>
>
>
> }
>
> 7) I will atach to this mail an archive with:
> a) OJB.properties
> b) repository.xml
> c) repository_database.xml
> d) repository_user.xml ()
>
> 8) The script to create the table Person is:
>
> CREATE TABLE [dbo].[PERSON] (
> [PKID] [numeric](18, 0) NOT NULL ,
> [COD] [numeric](18, 0) NOT NULL ,
> [NAME] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
> [DATA_INI] [datetime] NULL ,
> [DATA_FIN] [datetime] NULL ,
> [MGR_ID] [numeric](18, 0) NULL
> ) ON [PRIMARY]
> GO
>
>
>
>
> The problem is:
> I can'n make any persistent modifications in the database!
> What is the cause, can you tell me?
> Thank you very much!
>
>
------------------------------------------------------------------------
--------
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org