unable to select recently inserted object : Strange OJB behaviour

2004-12-26 Thread dave riveli
HI,
 
I have tried to access a database through a loop.
while the loop is running, I manually modify (in live)
and commit a record in the data base. The modification
is not detected, at the next incrementation within the
running loop.
 
What could be the problem? 
How can I solve this? 
It sounds as I am missing something...
 
Your help is precious;
 
Thanks


-
Do you Yahoo!?
 Yahoo! Mail - Find what you need with new enhanced search. Learn more.

Re: Referenced object not being picked up ...

2004-12-26 Thread Ray
Thanks Jakob ... :-)
retrieveAllReferences did the trick ...
Jakob Braeuchi wrote:
hi ray,
when getObjectByIdentity does not trigger a select then the object is 
already in the cache.

from your sqls i only can see inserts into pageCalendar. try to clear 
the cache after the inserts and then do getObjectByIdentity(); this 
should trigger a select.

btw. have you tried to retrieve all references ? 
broker#retrieveAllReferences(obj)

jakob
Ray schrieb:
Hi Jakob.
Got p6spy running, but the result was pretty much the same; all I got 
was this:


1104080183441|0|0|statement|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES (?,?,?,?,?) 
|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES ('true','Sun Dec 
26 16:56:14 GMT 2004','Sun Dec 26 16:56:14 GMT 2004','1','2')
1104080183472|10|0|statement||SELECT LAST_INSERT_ID() FROM 
pageCalendar LIMIT 1
1104080183502|0|0|commit||
1104080851692|60|0|statement|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES (?,?,?,?,?) 
|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES ('true','Sun Dec 
26 17:07:19 GMT 2004','Sun Dec 26 17:07:19 GMT 2004','1','2')
1104080851742|20|0|statement||SELECT LAST_INSERT_ID() FROM 
pageCalendar LIMIT 1
1104080851783|0|0|commit||
1104080993226|0|0|statement|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES (?,?,?,?,?) 
|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES ('true','Sun Dec 
26 17:09:44 GMT 2004','Sun Dec 26 17:09:44 GMT 2004','1','2')
1104080993256|20|0|statement||SELECT LAST_INSERT_ID() FROM 
pageCalendar LIMIT 1
1104080993296|0|0|commit||
1104081197389|0|0|statement|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES (?,?,?,?,?) 
|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES ('true','Sun Dec 
26 17:13:08 GMT 2004','Sun Dec 26 17:13:08 GMT 2004','1','2')
1104081197440|20|0|statement||SELECT LAST_INSERT_ID() FROM 
pageCalendar LIMIT 1
1104081197480|0|0|commit||
1104084153861|231|0|statement|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES (?,?,?,?,?) 
|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES ('true','Sun Dec 
26 18:02:22 GMT 2004','Sun Dec 26 18:02:22 GMT 2004','1','2')
1104084153921|20|0|statement||SELECT LAST_INSERT_ID() FROM 
pageCalendar LIMIT 1
1104084154021|10|0|rollback||
1104084379075|0|0|statement|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES (?,?,?,?,?) 
|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES ('true','Sun Dec 
26 18:06:10 GMT 2004','Sun Dec 26 18:06:10 GMT 2004','1','2')
1104084379135|20|0|statement||SELECT LAST_INSERT_ID() FROM 
pageCalendar LIMIT 1
1104084379175|0|0|commit||
1104086278976|150|0|statement|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES (?,?,?,?,?) 
|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES ('true','Sun Dec 
26 18:37:49 GMT 2004','Sun Dec 26 18:37:49 GMT 2004','1','2')
1104086279057|20|0|statement||SELECT LAST_INSERT_ID() FROM 
pageCalendar LIMIT 1
1104086279097|0|0|commit||
--

Seems that the getObjectIdentity doesn't generate any SQL code that 
shows up.

As far as I can tell, what I've done seems fine, except that I 
referencing the same table twice; my only guess is that that is 
causing OJB a problem (other references work OK).


Jakob Braeuchi wrote:
hi ray,
i'd better use p6spy to log the sql.
replace the mysql-driver in database.xml with the p6spy-driver:
...
driver="org.hsqldb.jdbcDriver"
...
in spy.properties you'll have to tell p6spy the real-driver:
...
# mysql Connector/J driver
realdriver=com.mysql.jdbc.Driver
...
jakob
Ray schrieb:
Yep. Okay.
--
12:17:32,875 DEBUG ConnectionFactoryPooledImpl:96 - createPool was 
called
12:17:32,946 DEBUG ConnectionFactoryPooledImpl:230 - makeObject called
12:17:36,390 DEBUG ConnectionFactoryAbstractImpl:273 - Create new 
connection using DriverManager: [EMAIL PROTECTED]
12:17:36,441 DEBUG ConnectionManagerImpl:118 - Request new 
connection from ConnectionFactory: [EMAIL PROTECTED]
12:17:36,471 DEBUG ConnectionManagerImpl:156 - localBegin was called 
for con [EMAIL PROTECTED]
12:17:36,481 DEBUG ConnectionManagerImpl:159 - Try to change 
autoCommit state to 'false'
12:17:36,631  INFO PersistenceBrokerImpl:777 - Cascade store for 
this reference-descriptor (content) was set to false.
12:17:36,641  INFO PersistenceBrokerImpl:777 - Cascade store for 
this reference-descriptor (template) was set to false.
12:17:36,941 DEBUG JdbcAccessImpl:182 - executeInsert : 
[EMAIL PROTECTED]
12:17:36,971 DEBUG SqlGeneratorDefaultImpl:114 - SQL:INSERT INTO 
pageCalendar (active,showFrom,showTo,conte

Re: Perfomance

2004-12-26 Thread Jakob Braeuchi
hi morales,
what version of ojb ?
what kind of sql ?
what dbms ?
jakob
Morales de Frías schrieb:
Hi to all¡¡
 
I'm confused because my sql's sentences in ojb run very slow.
Does anybody have any idea? how can i improove performance? 
 
Best regards
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Referenced object not being picked up ...

2004-12-26 Thread Jakob Braeuchi
hi ray,
when getObjectByIdentity does not trigger a select then the object is 
already in the cache.

from your sqls i only can see inserts into pageCalendar. try to clear 
the cache after the inserts and then do getObjectByIdentity(); this 
should trigger a select.

btw. have you tried to retrieve all references ? 
broker#retrieveAllReferences(obj)

jakob
Ray schrieb:
Hi Jakob.
Got p6spy running, but the result was pretty much the same; all I got 
was this:


1104080183441|0|0|statement|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES (?,?,?,?,?) |INSERT 
INTO pageCalendar (active,showFrom,showTo,contentId,templateId) VALUES 
('true','Sun Dec 26 16:56:14 GMT 2004','Sun Dec 26 16:56:14 GMT 
2004','1','2')
1104080183472|10|0|statement||SELECT LAST_INSERT_ID() FROM pageCalendar 
LIMIT 1
1104080183502|0|0|commit||
1104080851692|60|0|statement|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES (?,?,?,?,?) |INSERT 
INTO pageCalendar (active,showFrom,showTo,contentId,templateId) VALUES 
('true','Sun Dec 26 17:07:19 GMT 2004','Sun Dec 26 17:07:19 GMT 
2004','1','2')
1104080851742|20|0|statement||SELECT LAST_INSERT_ID() FROM pageCalendar 
LIMIT 1
1104080851783|0|0|commit||
1104080993226|0|0|statement|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES (?,?,?,?,?) |INSERT 
INTO pageCalendar (active,showFrom,showTo,contentId,templateId) VALUES 
('true','Sun Dec 26 17:09:44 GMT 2004','Sun Dec 26 17:09:44 GMT 
2004','1','2')
1104080993256|20|0|statement||SELECT LAST_INSERT_ID() FROM pageCalendar 
LIMIT 1
1104080993296|0|0|commit||
1104081197389|0|0|statement|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES (?,?,?,?,?) |INSERT 
INTO pageCalendar (active,showFrom,showTo,contentId,templateId) VALUES 
('true','Sun Dec 26 17:13:08 GMT 2004','Sun Dec 26 17:13:08 GMT 
2004','1','2')
1104081197440|20|0|statement||SELECT LAST_INSERT_ID() FROM pageCalendar 
LIMIT 1
1104081197480|0|0|commit||
1104084153861|231|0|statement|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES (?,?,?,?,?) |INSERT 
INTO pageCalendar (active,showFrom,showTo,contentId,templateId) VALUES 
('true','Sun Dec 26 18:02:22 GMT 2004','Sun Dec 26 18:02:22 GMT 
2004','1','2')
1104084153921|20|0|statement||SELECT LAST_INSERT_ID() FROM pageCalendar 
LIMIT 1
1104084154021|10|0|rollback||
1104084379075|0|0|statement|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES (?,?,?,?,?) |INSERT 
INTO pageCalendar (active,showFrom,showTo,contentId,templateId) VALUES 
('true','Sun Dec 26 18:06:10 GMT 2004','Sun Dec 26 18:06:10 GMT 
2004','1','2')
1104084379135|20|0|statement||SELECT LAST_INSERT_ID() FROM pageCalendar 
LIMIT 1
1104084379175|0|0|commit||
1104086278976|150|0|statement|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES (?,?,?,?,?) |INSERT 
INTO pageCalendar (active,showFrom,showTo,contentId,templateId) VALUES 
('true','Sun Dec 26 18:37:49 GMT 2004','Sun Dec 26 18:37:49 GMT 
2004','1','2')
1104086279057|20|0|statement||SELECT LAST_INSERT_ID() FROM pageCalendar 
LIMIT 1
1104086279097|0|0|commit||
--

Seems that the getObjectIdentity doesn't generate any SQL code that 
shows up.

As far as I can tell, what I've done seems fine, except that I 
referencing the same table twice; my only guess is that that is causing 
OJB a problem (other references work OK).


Jakob Braeuchi wrote:
hi ray,
i'd better use p6spy to log the sql.
replace the mysql-driver in database.xml with the p6spy-driver:
...
driver="org.hsqldb.jdbcDriver"
...
in spy.properties you'll have to tell p6spy the real-driver:
...
# mysql Connector/J driver
realdriver=com.mysql.jdbc.Driver
...
jakob
Ray schrieb:
Yep. Okay.
--
12:17:32,875 DEBUG ConnectionFactoryPooledImpl:96 - createPool was 
called
12:17:32,946 DEBUG ConnectionFactoryPooledImpl:230 - makeObject called
12:17:36,390 DEBUG ConnectionFactoryAbstractImpl:273 - Create new 
connection using DriverManager: [EMAIL PROTECTED]
12:17:36,441 DEBUG ConnectionManagerImpl:118 - Request new connection 
from ConnectionFactory: [EMAIL PROTECTED]
12:17:36,471 DEBUG ConnectionManagerImpl:156 - localBegin was called 
for con [EMAIL PROTECTED]
12:17:36,481 DEBUG ConnectionManagerImpl:159 - Try to change 
autoCommit state to 'false'
12:17:36,631  INFO PersistenceBrokerImpl:777 - Cascade store for this 
reference-descriptor (content) was set to false.
12:17:36,641  INFO PersistenceBrokerImpl:777 - Cascade store for this 
reference-descriptor (template) was set to false.
12:17:36,941 DEBUG JdbcAccessImpl:182 - executeInsert : 
[EMAIL PROTECTED]
12:17:36,971 DEBUG SqlGeneratorDefaultImpl:114 - SQL:INSERT INTO 
pageCalendar (active,showFrom,showTo,contentId,templateId) VALUES 
(?,?,?,?,?)
12:17:37,092 DEBUG JdbcAccessImpl:196 - execut

Re: Referenced object not being picked up ...

2004-12-26 Thread Ray
Hi Jakob.
Got p6spy running, but the result was pretty much the same; all I got 
was this:


1104080183441|0|0|statement|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES (?,?,?,?,?) |INSERT 
INTO pageCalendar (active,showFrom,showTo,contentId,templateId) VALUES 
('true','Sun Dec 26 16:56:14 GMT 2004','Sun Dec 26 16:56:14 GMT 
2004','1','2')
1104080183472|10|0|statement||SELECT LAST_INSERT_ID() FROM pageCalendar 
LIMIT 1
1104080183502|0|0|commit||
1104080851692|60|0|statement|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES (?,?,?,?,?) |INSERT 
INTO pageCalendar (active,showFrom,showTo,contentId,templateId) VALUES 
('true','Sun Dec 26 17:07:19 GMT 2004','Sun Dec 26 17:07:19 GMT 
2004','1','2')
1104080851742|20|0|statement||SELECT LAST_INSERT_ID() FROM pageCalendar 
LIMIT 1
1104080851783|0|0|commit||
1104080993226|0|0|statement|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES (?,?,?,?,?) |INSERT 
INTO pageCalendar (active,showFrom,showTo,contentId,templateId) VALUES 
('true','Sun Dec 26 17:09:44 GMT 2004','Sun Dec 26 17:09:44 GMT 
2004','1','2')
1104080993256|20|0|statement||SELECT LAST_INSERT_ID() FROM pageCalendar 
LIMIT 1
1104080993296|0|0|commit||
1104081197389|0|0|statement|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES (?,?,?,?,?) |INSERT 
INTO pageCalendar (active,showFrom,showTo,contentId,templateId) VALUES 
('true','Sun Dec 26 17:13:08 GMT 2004','Sun Dec 26 17:13:08 GMT 
2004','1','2')
1104081197440|20|0|statement||SELECT LAST_INSERT_ID() FROM pageCalendar 
LIMIT 1
1104081197480|0|0|commit||
1104084153861|231|0|statement|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES (?,?,?,?,?) |INSERT 
INTO pageCalendar (active,showFrom,showTo,contentId,templateId) VALUES 
('true','Sun Dec 26 18:02:22 GMT 2004','Sun Dec 26 18:02:22 GMT 
2004','1','2')
1104084153921|20|0|statement||SELECT LAST_INSERT_ID() FROM pageCalendar 
LIMIT 1
1104084154021|10|0|rollback||
1104084379075|0|0|statement|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES (?,?,?,?,?) |INSERT 
INTO pageCalendar (active,showFrom,showTo,contentId,templateId) VALUES 
('true','Sun Dec 26 18:06:10 GMT 2004','Sun Dec 26 18:06:10 GMT 
2004','1','2')
1104084379135|20|0|statement||SELECT LAST_INSERT_ID() FROM pageCalendar 
LIMIT 1
1104084379175|0|0|commit||
1104086278976|150|0|statement|INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES (?,?,?,?,?) |INSERT 
INTO pageCalendar (active,showFrom,showTo,contentId,templateId) VALUES 
('true','Sun Dec 26 18:37:49 GMT 2004','Sun Dec 26 18:37:49 GMT 
2004','1','2')
1104086279057|20|0|statement||SELECT LAST_INSERT_ID() FROM pageCalendar 
LIMIT 1
1104086279097|0|0|commit||
--

Seems that the getObjectIdentity doesn't generate any SQL code that 
shows up.

As far as I can tell, what I've done seems fine, except that I 
referencing the same table twice; my only guess is that that is causing 
OJB a problem (other references work OK).


Jakob Braeuchi wrote:
hi ray,
i'd better use p6spy to log the sql.
replace the mysql-driver in database.xml with the p6spy-driver:
...
driver="org.hsqldb.jdbcDriver"
...
in spy.properties you'll have to tell p6spy the real-driver:
...
# mysql Connector/J driver
realdriver=com.mysql.jdbc.Driver
...
jakob
Ray schrieb:
Yep. Okay.
--
12:17:32,875 DEBUG ConnectionFactoryPooledImpl:96 - createPool was called
12:17:32,946 DEBUG ConnectionFactoryPooledImpl:230 - makeObject called
12:17:36,390 DEBUG ConnectionFactoryAbstractImpl:273 - Create new 
connection using DriverManager: [EMAIL PROTECTED]
12:17:36,441 DEBUG ConnectionManagerImpl:118 - Request new connection 
from ConnectionFactory: [EMAIL PROTECTED]
12:17:36,471 DEBUG ConnectionManagerImpl:156 - localBegin was called 
for con [EMAIL PROTECTED]
12:17:36,481 DEBUG ConnectionManagerImpl:159 - Try to change 
autoCommit state to 'false'
12:17:36,631  INFO PersistenceBrokerImpl:777 - Cascade store for this 
reference-descriptor (content) was set to false.
12:17:36,641  INFO PersistenceBrokerImpl:777 - Cascade store for this 
reference-descriptor (template) was set to false.
12:17:36,941 DEBUG JdbcAccessImpl:182 - executeInsert : 
[EMAIL PROTECTED]
12:17:36,971 DEBUG SqlGeneratorDefaultImpl:114 - SQL:INSERT INTO 
pageCalendar (active,showFrom,showTo,contentId,templateId) VALUES 
(?,?,?,?,?)
12:17:37,092 DEBUG JdbcAccessImpl:196 - executeInsert: 
[EMAIL PROTECTED]: INSERT INTO pageCalendar 
(active,showFrom,showTo,contentId,templateId) VALUES 
('1','2004-12-24','2004-12-24',1,2)
12:17:37,252 DEBUG StatementManager:89 - closeResources was called
12:17:37,272 DEBUG SequenceManagerNativeImpl:231 - After store - newid=5
12:17:37,282  INFO CacheDistributor:98 - Create new 
ObjectCacheImplementation for 'scho

strange OJB behaviour

2004-12-26 Thread T. K. Chris
HI,

I have tried to access a database through a loop.
while the loop is running, I manually modify (in live)
and commit a record in the data base. The modification
is not detected, at the next incrementation within the
running loop.

What could be the problem. It sounds as I am missing
something...

Your help is precious;
Thanks.

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]