stanislav bashkirtsev

Ranch Hand
+ Follow
since Aug 17, 2009
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by stanislav bashkirtsev

Maybe the only way is to create bidirectional relationships...
There are two of "select"((( It's very bad for performance(
1. I have Customer. It has many Accounts.
2. I have Payment, that has one Account.
Question: how can I fetch all payments where customer=?
The SQL is something like this:
What it will be look like in HQL?
The problem was not about nested transactions. Some operation with database were simply performed in other connection.
My TransactionManager has field "nextedTransactionAllowed". But when I set it "true", nothing changes.
I'm working with MySQL and I have 2 transaction, one is within the other.
Inner transaction:
Class-helper, that works with Hibernate-transactions:
The inner transaction is committed. But when the external transaction is tried to be committed, we wait 100 seconds(this is configured in configuration of MySQL), then the exception is thrown. Here is the log that contains the error:

[19:44:40] jt.monty: Hibernate: select as id29_1_, this_.username as username29_1_, this_.password as password29_1_, this_.framedIP as framedIP29_1_, this_.framedMask as framedMask29_1_, this_.blocked as blocked29_1_, this_.checkHost as checkHost29_1_, this_.ipPool as ipPool29_1_, this_.lastConnection as lastConn9_29_1_, this_.service as service29_1_, as id24_0_, service2_.status as status24_0_, service2_.begin as begin24_0_, service2_.end as end24_0_, service2_.serviceInfoId as serviceI5_24_0_, service2_.tariffPlanId as tariffPl6_24_0_, service2_.accountId as accountId24_0_ from RadiusAccount this_ inner join services service2_ on where and 1=1
Hibernate: select as id24_2_, this_.status as status24_2_, this_.begin as begin24_2_, this_.end as end24_2_, this_.serviceInfoId as serviceI5_24_2_, this_.tariffPlanId as tariffPl6_24_2_, this_.accountId as accountId24_2_, as id4_0_, tariffplan2_.title as title4_0_, tariffplan2_.userCharge as userCharge4_0_, tariffplan2_.type as type4_0_, tariffplan2_.beginDate as beginDate4_0_, tariffplan2_.endDate as endDate4_0_, as id12_1_, account3_.number as number12_1_, account3_.balance as balance12_1_, account3_.type as type12_1_, account3_.status as status12_1_ from services this_ left outer join tariffPlans tariffplan2_ on inner join accounts account3_ on where and 1=1
Hibernate: select tariffs0_.tariffPlanId as tariffPl4_1_, as id1_, tariffs0_.orderIndex as orderIndex1_, as id0_0_, tariffs0_.price as price0_0_, tariffs0_.title as title0_0_ from tariffs tariffs0_ where tariffs0_.tariffPlanId=?
Hibernate: select properties0_.tariffId as tariffId0_, properties0_.value as value0_, as property0_ from tariffProperties properties0_ where properties0_.tariffId=?
Hibernate: select as id85_0_, this_.status as status85_0_, this_.begin as begin85_0_, this_.end as end85_0_, this_.serviceInfoId as serviceI5_85_0_, this_.tariffPlanId as tariffPl6_85_0_, this_.accountId as accountId85_0_ from services this_ where this_.accountId=? and 1=1
Hibernate: insert into financialOperations (balance, description, operationSum, accountId, date) values (?, ?, ?, ?, ?)
Hibernate: insert into serviceExpences (price, saveDate, account, tariffPlan, service) values (?, ?, ?, ?, ?)
Hibernate: update accounts set number=?, balance=?, type=?, status=? where id=?
2009-10-06 20:42:35,031 WARN net.jradius.freeradius.FreeRadiusProcessor(5) [org.hibernate.util.JDBCExceptionReporter] - SQL Error: 1205, SQLState: 41000
2009-10-06 20:42:35,031 ERROR net.jradius.freeradius.FreeRadiusProcessor(5) [org.hibernate.util.JDBCExceptionReporter] - Lock wait timeout exceeded; try restarting transaction
2009-10-06 20:42:35,031 ERROR net.jradius.freeradius.FreeRadiusProcessor(5) [org.hibernate.event.def.AbstractFlushingEventListener] - Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: could not update: [model.entity.customer.account.Account#1]
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(
at org.hibernate.exception.SQLStateConverter.convert(
at org.hibernate.exception.JDBCExceptionHelper.convert(
at org.hibernate.persister.entity.AbstractEntityPersister.update(
at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(
at org.hibernate.persister.entity.AbstractEntityPersister.update(
at org.hibernate.action.EntityUpdateAction.execute(
at org.hibernate.engine.ActionQueue.execute(
at org.hibernate.engine.ActionQueue.executeActions(
at org.hibernate.engine.ActionQueue.executeActions(
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(
at org.hibernate.impl.SessionImpl.flush(
at org.springframework.orm.hibernate3.SpringSessionSynchronization.beforeCommit(
at model.dao.TransactionManager.commit(
at tariffication.TarifficationManagerImpl.saveData(
at tariffication.TarifficationManagerImpl.tariffy(
at radius.accounting.SessionUpdater.tariffySession(
at radius.accounting.processor.SessionUpdateProcessor.proccessSession(
at radius.controller.impl.AccountingController.handleRequest(
at radius.RadiusRequestHandler.handle(
at radius.dispatcher.RadiusRequestDispatcher.handle(
at net.jradius.handler.PacketHandlerBase.handle(
at net.jradius.handler.EventHandlerBase.execute(
at net.jradius.server.RadiusProcessor.runPacketHandlers(
at net.jradius.freeradius.FreeRadiusProcessor.processRequest(
at net.jradius.server.Processor.process(
Caused by: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
at com.mysql.jdbc.SQLError.createSQLException(
at com.mysql.jdbc.SQLError.createSQLException(
at com.mysql.jdbc.MysqlIO.checkErrorPacket(
at com.mysql.jdbc.MysqlIO.checkErrorPacket(
at com.mysql.jdbc.MysqlIO.sendCommand(
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(
at com.mysql.jdbc.ConnectionImpl.execSQL(
at com.mysql.jdbc.PreparedStatement.executeInternal(
at com.mysql.jdbc.PreparedStatement.executeUpdate(
at com.mysql.jdbc.PreparedStatement.executeUpdate(
at com.mysql.jdbc.PreparedStatement.executeUpdate(
at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(
at org.hibernate.persister.entity.AbstractEntityPersister.update(
... 28 more

Maybe someone can help me? I don't even know the source of the problem...
Here what I needed:

Thanks for your attention!
In JDK there is old bad version of JAXB, so we should use separate libs. I saw this repositories, but I don't want to search for every lib in it( So I want somebody to show their dependencies from their projects..
Can you give me, please, all needed maven-dependencies for jaxb, jax-ws? I don't actually use JAXB, I should code another part of application, but I need to write dependencies in maven for jaxb, jax-ws to build and run entire application.
EE Application is an application of enterprise scale.
As far as I know JDBC, for example, is EE technology.
8 years ago
There is no any really good books on Flex. I read OReilly Learning Flex 3 Jun 2008 for knowing core. And then I will continue with this book. But one experienced developer said me that the main knowledge I would gain only from my own experience.
8 years ago
How DI can help to reduce amount of factories?
Use System.out.printf or NumberFormat.
8 years ago

makes appropriate calls to various subsystems

It's an Observer. Observer consists of Subject that has a list of Observers. When some event is triggered, this Subject iterates the whole list and invoke some method in each of Observers.
HashMap sorts by the hash of the keys. Use TreeMap to sort by key values.
8 years ago