Hi Tobi,

Am 12.09.2014 um 00:34 schrieb Tobias Boege:

>> By a look at "create_table.sql" I see you have not so much sense of
>> databases ;-)
> 
> This is not my code. I'm just forwarding a bug report to the list.

Ok :) Sorry for that ...

>> could be eventually dangerous. You should define the columns where you
>> want to insert your data:
>>
>> "insert into kontakte (id, vorname, ...) values (1, 'Tobias', ...) (2,
>> 'Albert', ...)"
>>
>> etc.
>>
> That's how I learned it in school, too. And guess what: the material I
> learned it from was from the same person which did it wrong here :-)

:-) Not every teacher is a good db programmer. It's better to name the
columns you want to access, because not always you use all columns and
later on you can change the order of columns in a table without breaking
your previously written program, as long as you do not remove columns.

>> It seems that you use 2 connections at the same time in your application
>> that want to write the same tuple (or table, MyISAM engine  does table
>> level locking IMHO).
> 
> Umm, I don't think there are two Connections involved here... Where do you
> see that?

I did not test it. I see this by the symptoms. Your application and the
database create load but do nothing. I guess, they talk to each other
and say:

App: Write Data please
DB: No, forbidden, table is locked, try later ...
App: Write Data please
DB: No, forbidden, table is locked, try later ...
...

And because there is nobody else writing on the same table except your
app, there must be the error.

>> Remove that code that creates a table from the connect function (that is
>> really bad).
> 
> This piece of code there I recognise. It's from the PictureDatabase example
> delivered with Gambas. So you suggest keeping table creation somewhere else?

Yes, the function establishes one time the connection to db and this
functionality is normally used ever and ever in a database frontend
program. Why should it contain the functionality to create tables?

> Rumour has it that you want to contribute to Gambas, so changing the
> PictureDatabase example to be less "bad" would be a good start!

Grmbl.

> Have you tested that? Do you have a patch for the project?

No. I don't even know how to create a patch for Gambas.

Where is the example you are talking about? ... Ah ok, now I see it. But
that works. The db connection code is not very well designed (mixes
functionality), but ok ...


Alles Gute

Christof Thalhofer

-- 
Dies ist keine Signatur

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to