block size exceeds implementation restriction

258 views
Skip to first unread message

Philip

unread,
Aug 1, 2008, 9:28:01 AM8/1/08
to
Hi

I am doing an OCL select with a large number of parameters.

It works fine with the normal OCL service, but if I use oclPS I get
the following error:

Implementation limit exceeded
block size exceeds implementation restriction

DatabaseOperationFailedException in Eco.Persistence

Method:
Void
Eco.Persistence.IPersistenceMapper.FetchIDListWithCondition(Eco.Persistence.AbstractCondition,
Eco.DataRepresentation.ObjectIdList ByRef, Int32, Int32)

Inner Exception:
Borland.Data.Common.BdpException: Implementation limit exceeded
block size exceeds implementation restriction
at Borland.Data.Provider.BdpCommand.Prepare()

Dmitriy Nagirnyak

unread,
Aug 2, 2008, 7:37:16 AM8/2/08
to
Hello Philip,

> Inner Exception:
> Borland.Data.Common.BdpException: Implementation limit exceeded
> block size exceeds implementation restriction
> at Borland.Data.Provider.BdpCommand.Prepare()

I'm not confident in the BDP, but quick googling (http://www.google.com/search?q=BDP+Implementation+limit+exceeded+block+size+exceeds+implementation+restriction)
gives me this page about Firebird (I think it is your DB):
http://www.firebirdfaq.org/faq299/

It says that SQL statement can be less than 64 KB.

Anyway, I believe there's something wrong in your implementation if execute
such a huge query.
Any DBA would probably just shut down your application after seeing this
query.

I'd strongly suggest to consider a better implementation.

Cheers,
Dmitriy.


Philip

unread,
Aug 2, 2008, 7:47:43 AM8/2/08
to
I think you are right about firebird.

Good thing i am the DBA.

I am mapping the relationship of various words between sentences...

millions and millions of them...

the code will take a few weeks to run...

I am already using a combination of Lucene full text indexing and
firebird.

Philip

unread,
Aug 2, 2008, 7:52:50 AM8/2/08
to
Maybe I should explain better what I am doing.

I have a class called KeyConcepts which is just one field of type
string. KeyConcept has about 30 000 rows in it.

Then I have a very long sentence, and I want to find out if it
contains any of the KeyConcepts

So I am breaking the long sentence into words and doing a

KeyConcept.allinstances
->select(Name.SqlLikeCaseInsensitive('% word1 %') or
->select(Name.SqlLikeCaseInsensitive('% word2 %') or
->select(Name.SqlLikeCaseInsensitive('% word3 %') or
->select(Name.SqlLikeCaseInsensitive('% word4 %') or

I am sure I will kick myself when somebody here thinks of a better way
of doing this.

Dmitriy Nagirnyak

unread,
Aug 2, 2008, 11:39:54 AM8/2/08
to
Hello Philip,

> KeyConcept.allinstances ->select(Name.SqlLikeCaseInsensitive('% word1
> %') or ->select(Name.SqlLikeCaseInsensitive('% word2 %') or
> ->select(Name.SqlLikeCaseInsensitive('% word3 %') or
> ->select(Name.SqlLikeCaseInsensitive('% word4 %') or
>

I don't think there's easy solution with ECO. You'd probably really use Full
Text Search facility or something like this at least:
http://weblogs.sqlteam.com/jeffs/archive/2004/11/02/2460.aspx

Cheers,
Dmitriy.


Dmitriy Nagirnyak

unread,
Aug 2, 2008, 11:57:17 AM8/2/08
to
I think best solution with SQL (no full-text search) will be:

1. Generate SQL query
Or maybe generate SQL like this:

select ECO_ID, ECO_TYPE from KeyConcepts
where lower(Name) like @word1
and lower(Name) like @word2
(...and so on...)
and lower(Name) like @wordN

Use parameters in @wordX such as "%food%" or "%dring%".

2. Construct ECO objects based on the resulting DataSet using something like
this:
http://groups.google.com/group/borland.public.delphi.modeldrivenarchitecture.eco/browse_thread/thread/1b83ca4c2a82cede/707e3b32905f9fed?hl=en&lnk=st&q=Dmitriy+Nagirnyak+GetObjectByID#707e3b32905f9fed

It should much easier easy with new ECO Cache service.
See sample CustomFetch sample in ECO installation.

Cheers.


Philip

unread,
Aug 2, 2008, 12:01:14 PM8/2/08
to
but thats exactly what I'm doing with ocl...

it's firebird that dosnt allow the long selects.

i'll just have to split it up.

Dmitriy Nagirnyak

unread,
Aug 3, 2008, 2:47:45 AM8/3/08
to
Hello Philip,

> but thats exactly what I'm doing with ocl...
> it's firebird that dosnt allow the long selects.

Ohh. Yes. Sorry.
But maybe custom generated query can be shorter then ECO generated one.
If it's the case maybe it's worth trying.

But anyway you can split it in number of similar queries and then populate
ECO objects based on result of many queries but not single one.


Philip

unread,
Aug 3, 2008, 5:20:07 AM8/3/08
to

>
>But anyway you can split it in number of similar queries and then populate
>ECO objects based on result of many queries but not single one.
>

I like that idea.

Thanks

Reply all
Reply to author
Forward
0 new messages